Microsoft
Software
Hardware
Network
Question : Update sql cell
I have a simple text box and submit btn in a html form that send
a variable to a php file the php itself is suposed to update 1 field on a sql database below is the code
extract( $_POST );
$iserror = false;
if ( !$iserror )
{
$query = "UPDATE contacts" .
SET (LastName) = '$lname' .
WHERE (id) = "1";
// Connect to MySQL
if ( !( $database = mysql_connect( "localhost",
"zahi", "zahi" ) ) )
die( "Could not connect to database" );
// open MailingList database
if ( !mysql_select_db( "MailingList", $database ) )
die( "Could not open MailingList database" );
// execute query in MailingList database
if ( !( $result = mysql_query( $query, $database ) ) )
{
print( "Could not execute query!
" );
die( mysql_error() );
} // end if
mysql_close( $database );
print( "
Click here to view ur field.
" );
die();
}
?>
i keep on getting syntax and fatal errors any one knows why?
Thanks in advance
PS. i added an image so you can see the sql setup
Answer : Update sql cell
I'm sorry, another try:
$query = "UPDATE contacts" .
" SET LastName = '$lname'" .
" WHERE (id) = 1";
Random Solutions
Excel 2007 wont open for Windows 7 OS
Explorer.exe breadcrumbs control( How do I get the windows handle?)
What is the most liklely cause of a numeric field overflow error
How to modify a field length on Live Database SQL Server 2008 - Error Message "Saving Changes is not permitted..."
cannot apply default email address policy
How to change SQL 2008 reporting services from native mode to sharepoint integrated mode
Checking a Dataset for DBNull whiclst using the Compute SUM function
Having Trouble Keeping SBS C: Drive Defragmented
Converting Dates with SQL
ORA-12514 TNS:listener does not currently know of service requested in connect (yet agian?)