OFB Community Mailing Lists

The following archives are provided as a public service to the community. Opinions archived here do not necessarily represent the opinions of Open for Business or its contributors.

[CS-FSLUG] another sql qustions

Frank Bax fbax at sympatico.ca
Sat Dec 27 15:37:13 CST 2008


David McGlone wrote:
> it seems everything is working except it is not getting inserted into the database.
> 
> $query = "UPDATE workshop subheaderText SET NULL,
>         subheaderText='".$_POST['subheaderText']."',
>         headerText='".$_POST['headerText']."',
> 	page='".$_POST['pageID']."'
>         WHERE subheaderTextID='".$_POST['subheaderTextID']."'";
> 
> $query2= "SELECT * FROM subheaderText WHERE subheaderTextid=1";
> $result2= @mysql_query($query2);



You create a string called $query and then never send it to mysql!  You 
should also test $result after every call to mysql_query; in case the 
query fails.

$query = "UPDATE ....
$result = @mysql_query($query);
if (!$result) { die($query.' ERROR: '.mysql_error()); }

$query2= "SELECT * FROM subheaderText WHERE subheaderTextid=1";
$result2= @mysql_query($query2);
if (!$result2) { die($query2.' ERROR: '.mysql_error()); }



More information about the Christiansource mailing list
Home About Connect: Twitter Facebook RSS
© 2001-2011 Universal Networks, All Rights Reserved. Some content rights may be held by Universal Networks' providers and used under license. Powered by ServerForest and SAFARI. Learn about our privacy policy here.