[nycphp-talk] MySQL table updating
Andy Dirnberger
dirn at dirnonline.com
Wed Dec 5 17:30:31 EST 2007
> #select the specified database
> $rs = mysql_select_db( "test_db", $conn ) or die( "Err:Db" );
>
> #create
> $rs = mysql_query( $sql, $conn );
>
> $query = ("UPDATE tr_test_record
> SET tr_actualdata = '$actualdata', tr_actualresult =
> '$actualresult', tr_testnote = '$testnote'
> WHERE tr_access = '$access'
> AND tr_testno = '$testno'
> LIMIT 1");
>
Perhaps I am reading this wrong, but it appears you are calling
mysql_query() using a variable called $sql which never has a value (thus
executing no query at all), and then in the next line of code you are
setting $query equal to your query.
Try doing $rs = mysql_query ($query, $conn); after you assign the string to
$query.
More information about the talk
mailing list