problem : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's job is to deliver the orders to his customers on the beach in time! ' WHERE g' at line 1 problem : without update i got all the data printed . without while the single data is updated . with update & while i got the error !!!! // Make a MySQL Connection mysql_connect("localhost", "username", "pass") or die(mysql_error()); mysql_select_db("databasetry") or die(mysql_error()); // Get all the data from the "text" table $alldata = mysql_query("SELECT * FROM text") or die(mysql_error()); // keeps getting the next row until there are no more to get while($row = mysql_fetch_array( $alldata )) { // tryprint echo $row['texttitle']; $temparray[0] = 1; // update $catroom = mysql_query("UPDATE text SET textdesc='$temparray[0] <BR> $row[textdesc]' WHERE textid='$row[textid]'") or die(mysql_error()); } ?> Code (markup):
Hi, try to copy this : "UPDATE text SET textdesc='".$temparray[0]." <BR> ".$row[textdesc]."' WHERE textid='".$row[textid]."'" I guess you problem is that you're using the array as a string and not the real value Does it work now?
Actually, "UPDATE text SET textdesc='".mysql_real_escape_string($temparray[0])." <BR> ".mysql_real_escape_string($row[textdesc])."' WHERE textid='".mysql_real_escape_string($row[textid])."'"
Dirty-Rockstar , i did but the data base wasn't updated i am not just copy and glue . no error and no update . the data base should be updated ! the code above by me ,update the data base, this not update the data base.
$catroom = mysql_query("UPDATE games SET gamedesc='".mysql_real_escape_string($temparray[0])." <BR> ".mysql_real_escape_string($row[gamedesc])."' WHERE gamedesc='".mysql_real_escape_string($row[gameid])."'") or die(mysql_error()); Code (markup): this my code . it isn't update data .
mysql_query("UPDATE text SET textdesc='".mysql_real_escape_string($temparray[0])." <BR> ".mysql_real_escape_string($row[textdesc])."' WHERE textid='".mysql_real_escape_string($row[textid])."'"); PHP: kyosys's
works !!!!!!!!!!!!!!!!!!! thanks a lot . it was my small mistake !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! wow !!!!!!!