php Modify


Making changes to data in Mysql.

Posted on June  14th, 2009 by Technology Department 

We’ve already put out mobile phone number in the announcement but we haven’t heard anything. None has rung and none has sent an email. Perhaps it’s too expensive? I have to lower the price. We’ll see how to make changes to one of the fields of an announcement in this page.
To do this we will have enter some keys, in the case of this programme, my email address and the password that we introduced when we registered the announcement. 

 Mysql Code

 

<?php

$code = “computer”;

include(“config.inc.php”);
$conexion = mysql_connect($db_host,$db_user,$db_pass);
mysql_select_db(“$db_name”, $conexion);

$queEmp = “SELECT * FROM $db_table WHERE field_6 = ‘$code’ ORDER BY id DESC LIMIT 10 “;
$resEmp = mysql_query($queEmp, $conexion) or die(mysql_error());
$totEmp = mysql_num_rows($resEmp);

 

 

while ($rowEmp = mysql_fetch_assoc($resEmp)) {?>

<table border=”1″ width=”92%” bordercolor=”#333399″ style=”border-collapse: collapse”>
<tr>
<td width=”165″ bgcolor=”#E6E0C0″ bordercolorlight=”#FF9933″ bordercolordark=”#FF6600″ bordercolor=”#FF6600″ rowspan=”2″>
<font size=”1″>

<img border=”0″ src=”images/schedule.png” width=”27″ height=”26″ align=”left” hspace=”1″></font><p>
<font size=”1″>

 

<? echo $rowEmp[‘field_10’];?>

</font></p>
<p>
<font size=”1″>
<?
$base = “https://www.petervaldivia.com/technology/php/board/”;

$image1 = $rowEmp[‘field_9’];

$image2 = substr ($image1, 7);
$image3 = “thumbs/”.$image2;

echo “<a href=# onclick= abrirpopup(‘$image1′,500,500)> <img src=’$image3′ border=’1′ class= borde></a>”;
border=’1’ class= borde></a>”;

?></font></p>
<td bgcolor=”#B6E5FF”>
<p style=”margin-top: 0; margin-bottom: 0″><font size=”2″>

</span> </font><b>
<font size=”2″>
<img border=”0″ src=”images/money-bag.png” width=”32″ height=”32″ align=”left”> <? echo $rowEmp[‘field_11’];?> €</font></b><font size=”2″><b><span lang=”es”>
</span></b> </font> </p>
<p style=”margin-top: 0; margin-bottom: 0″><font size=”2″><b>
<font color=”#FF3300″>Title</font></b><font color=”#FF3300″></b></font>:<b><font color=”#333399″> <? echo $rowEmp[‘field_8’];?>
</font></b> </font> </p></td>
</tr>
<tr>

<td bgcolor=”#B6E5FF”>
<p style=”margin-top: 0; margin-bottom: 0″><b>
<font size=”2″ color=”#FF3300″>Description</font></b><font size=”2″>: <?

$string1 = $rowEmp[‘field_7’];

$description = substr($string1,0,400);

echo $description;?>
</font><b>
<font size=”2″>&nbsp;<font color=”#FF3300″>Owner</font>:<? echo $rowEmp[‘field_1’];?> </font>
</b>

<img border=”0″ src=”images/HP-Mobile-2.png” width=”32″ height=”32″ > <? echo $rowEmp[‘field_5’];?>
<img border=”0″ src=”images/address-book-2.png” width=”32″ height=”32″> <? echo $rowEmp[‘field_3’];?>
<b>
<span lang=”es”>
<font size=”2″>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

</font>
</p></td>
</tr>
</table>
<?
}
}
?>