Re: Why won't this query go through?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> From: Richard Lynch <ceo@xxxxxxxxx>
> On Sun, March 11, 2007 11:24 am, Mike Shanley wrote:
>> I am just not understanding what I could have possibly done wrong with
>> this query. All of the variables are good, without special characters
>> in
>> any sense of the word... So why isn't it importing anything?
>> 
>> Thanks!
>> 
>>  $q = "INSERT INTO
>> `visitors`(`username`,`password`,`email`,`firstname`,`lastname`,`birthdate`,`
>> verifythis`)
>>                         VALUES ('".$username."',
>>                                 '".md5($password1)."',
>>                                 '".$email."',
>>                                 '".$firstname."',
>>                                 '".$lastname."',
>>                                 '".$birthdate."',
>>                                 '".$verifythis."');";
>> mysql_query($q);
> 
> I don't know.
> 
> But MySQL is just DYING to TELL you what went wrong.
> 
> mysql_query($q) or die(mysql_error());
> 
> is what you should be using.
> 
> For now.
> 
> Later, you'll want a better error handling method than "or die()"


And sending this to a MySQL user group, rather then a PHP group, might get a
better response too...

Just for future error reference.. ;)


<?php
/*

Stephen Johnson c | eh
The Lone Coder

http://www.ouradoptionblog.com
Join our journey of adoption

http://www.thelonecoder.com
stephen@xxxxxxxxxxxxxxxx

continuing the struggle against bad code

*/ 
?>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux