Hello everyone!
I have a quick question. Can MySql do both retrive records and modify the values in them at the same time? For example, the code below reads records one at a time on the screen.
$db=mysql_connect("mycomputer","yourname",""
or die("Could not connect : " . mysql_error());
mysql_pconnect();
mysql_select_db("mytable" or die("Could not select database"
$query = ("SELECT * FROM myimagexx where ID=$count"
$result = mysql_query($query) or die("Query failed : " . mysql_error());
$num_rows = mysql_num_rows($result);
if ($v5=5){;
$sql = "INSERT INTO `myimagexx` (`v5`) VALUES ('" . $v5. "')";
}
echo "$num_rows Rows\n";
while ($row= mysql_fetch_array($result))
//I used the sessions command increment the page visit by //one for the $count varible. It works fine for retriving records one at a time on screen. What I really want to do is not add records but to modify one. So lets say, 'v5' was 1 it was changed to 2.
Please let me know if you need more information.
Thanks
KJ
I have a quick question. Can MySql do both retrive records and modify the values in them at the same time? For example, the code below reads records one at a time on the screen.
$db=mysql_connect("mycomputer","yourname",""
or die("Could not connect : " . mysql_error());
mysql_pconnect();
mysql_select_db("mytable" or die("Could not select database"
$query = ("SELECT * FROM myimagexx where ID=$count"
$result = mysql_query($query) or die("Query failed : " . mysql_error());
$num_rows = mysql_num_rows($result);
if ($v5=5){;
$sql = "INSERT INTO `myimagexx` (`v5`) VALUES ('" . $v5. "')";
}
echo "$num_rows Rows\n";
while ($row= mysql_fetch_array($result))
//I used the sessions command increment the page visit by //one for the $count varible. It works fine for retriving records one at a time on screen. What I really want to do is not add records but to modify one. So lets say, 'v5' was 1 it was changed to 2.
Please let me know if you need more information.
Thanks
KJ