You are here: Re: [PHP] Inserting records question « PHP « IT news, forums, messages
Re: [PHP] Inserting records question

Posted by Scott Noyes on 09/09/05 04:42

> mysql_connect(localhost,$username,$password);
> @mysql_select_db("$database") or die("Unable to Connect to DB");
> $tc_query = "INSERT INTO $tablel VALUES(NULL, $lname, $fname, $machine_name,
> $email_addr, $problem, NULL)";
> $result = mysql_query($tc_query);

It's always nice to check if the query even ran, using "or
die(mysql_error())". You might also want to print out the query
itself to see if there are missing values. Perhaps you're relying on
register globals, which is turned off?

$result = mysql_query($tc_query) or die(mysql_error() . " in the query
$tc_query";

 

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

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