[PHP] Re: PHP/MYSQL query error

2002-08-26 Thread Chris Crane

I did some more testing and I found that I forgot the first field in the
columns section of the Statement. So now it looks like this:
I also copy and pasted the statement into PHPMYADMIN and it worked fine. It
just doesn't work here


function AddSignupRequest($Signup_FName, $Signup_LName, $Signup_Address1,
$Signup_Address2, $Signup_City,
$Signup_State, $Signup_Zip, $Signup_Email, $Signup_Phone,
$Signup_ContactMethod,
$Signup_Date, $Signup_IP, $Signup_Status, $Signup_Comments) {
/* Connecting, selecting database */
$dbh=mysql_connect ($MySQL_Host,  $MySQL_User, $MySQL_Password) or die
('I cannot connect to the database.');
 mysql_select_db ("havasuin_Signups");

/* Performing SQL query */
$query = "INSERT INTO SignupRequests ('SignupID', 'FirstName',
'LastName', 'Address1', 'Address2',
 'City', 'State', 'Zip', 'Email', 'Phone', 'ContactMethod', 'Date',
'IP', 'Status', 'Comments')
VALUES ('', 'Chris', 'Crane', '655 Talcottville Road', 'Apt. 185',
'Vernon', 'CT', '06066', '[EMAIL PROTECTED]',
 '860-659-6464', 'Email', 'August 25, 2002', '64.252.232.82', 'Newly
Requested', 'Testing')";
$result = mysql_query($query) or die("Query failed");

/* Free resultset */
mysql_free_result($result);

/* Closing connection */
mysql_close($link);
 print "$Signup_LName, $Signup_FName\n";

}

"Chris Crane" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I am getting a failed query error message. Could someone take a look and
let
> me know.
>
> //F U N C T I O N S
> //=
> function AddSignupRequest($Signup_FName, $Signup_LName, $Signup_Address1,
> $Signup_Address2, $Signup_City,
> $Signup_State, $Signup_Zip, $Signup_Email, $Signup_Phone,
> $Signup_ContactMethod,
> $Signup_Date, $Signup_IP, $Signup_Status, $Signup_Comments) {
> /* Connecting, selecting database */
> $dbh=mysql_connect ($MySQL_Host,  $MySQL_User, $MySQL_Password) or die
> ('I cannot connect to the database.');
>  mysql_select_db ("havasuin_Signups");
>
> /* Performing SQL query */
> $query = "INSERT INTO SignupRequests ('FirstName', 'LastName',
> 'Address1', 'Address2',
>  'City', 'State', 'Zip', 'Email', 'Phone', 'ContactMethod', 'Date',
> 'IP', 'Status', 'Comments')
> VALUES ('', 'Chris', 'Crane', '655 Talcottville Road', 'Apt. 185',
> 'Vernon', 'CT', '06066', '[EMAIL PROTECTED]',
>  '860-659-6464', 'Email', 'August 25, 2002', '64.252.232.82', 'Newly
> Requested', 'Testing')";
> $result = mysql_query($query) or die("Query failed");
>
> /* Free resultset */
> mysql_free_result($result);
>
> /* Closing connection */
> mysql_close($link);
>  print "$Signup_LName, $Signup_FName\n";
>
> }
>
>



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




RE: [PHP] MySQL Query Error

2001-01-21 Thread Matt Stone

No, that is exactly as the PHPLib Debug function is returning... :|

-Original Message-
From: Samantha Savvakis [mailto:[EMAIL PROTECTED]]
Sent: Monday, 22 January 2001 3:21 PM
To: Matt Stone
Subject: RE: [PHP] MySQL Query Error


I'm not sure why are getting that error.

Is the statement you are running exactly the same as the one posted in the
email? Check that you don't have a "comma" after the "images i" part. If i
put a comma there, I can simulate your error. Otherwise, your syntax to me
seems fine.

> -Original Message-
> From: Matt Stone [mailto:[EMAIL PROTECTED]]
> Sent: Monday, 22 January 2001 15:01
> To: PHP List
> Subject: [PHP] MySQL Query Error
>
>
> Hi,
> I have a MySQL statement, namely:
> SELECT COUNT(*) AS Count FROM images i LEFT JOIN categories c ON
> i.cat_id=c.id LEFT JOIN subcategories s ON i.subcat_id=s.id
>
> I want to change the LEFT JOINs to INNER JOINs like so:
> SELECT COUNT(*) AS Count FROM images i INNER JOIN categories c ON
> i.cat_id=c.id INNER JOIN subcategories s ON i.subcat_id=s.id
>
> But as soon as I do that I get this error message:
> MySQL Error: 1064 (You have an error in your SQL syntax near 'INNER JOIN
> categories c ON i.cat_id=c.id INNER JOIN subcategories s ON i.subcat_' at
> line 1)
> Session halted.
>
> Help please. Thanks,
>
> Matt Stone
> ___
>
> This email may contain confidential and/or privileged information for the
> sole use of the intended recipient. Any review or distribution by
> others is
> strictly prohibited. If you have received this email in error, please
> contact the sender and delete all copies. Opinions, conclusions or other
> information expressed or contained in this email are not given or endorsed
> by the sender unless otherwise affirmed independently by the sender.
>
> _
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]