You are here: Re: the script wont work and i cant find anything wrong please help « PHP Programming Language « IT news, forums, messages
Re: the script wont work and i cant find anything wrong please help

Posted by Pedro Graca on 11/24/06 16:17

so many sites so little time wrote:

<snip>

> if (isset ($_POST['submit'])) { // Handle the form.
>
> // Define the query.
> $query = "UPDATE home SET header='{$_POST['header']}',
> body='{$_POST['body']}' WHERE home_id={$_POST['id']}";
> $r = mysql_query ($query); // Execute the query.

<snip>

> could you please help, thanks, and have a happy thanksgiving

Check the return value of mysql_* calls.

Where I snipped add

if (!$r) {
// There was an error
// for simplicity sake, I'll just print it and exit
exit('Error in query (' . $query . '): ' . mysql_error());
}

Add similar code after *all* relevant mysql_* calls.
When you run the script and there is an error, the script itself will
tell you why it failed. After that you just need to (understand the
reason for failure and) correct the error and try again.

--
I (almost) never check the dodgeit address.
If you *really* need to mail me, use the address in the Reply-To
header with a message in *plain* *text* *without* *attachments*.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация