Jump to content

[SOLVED] INSERT INTO trouble


sketcht

Recommended Posts

I'm going a little nuts over this simple code, if someone could check this over I would very much appreciate it.

 

I have Table named Clients

I am trying to insert some posted vars into said table...

but it's not doing anything.

php v5.2.9

mySQL v5.0.75

 

 

Table: Clients

---------------------------------------------------------------------------

EmailAddress  UserPassword FirstName LastName  BusinessName

 

 

$sql="INSERT INTO Clients(EmailAddress, UserPassword, FirstName, LastName, BusinessName)

VALUES('$email_address', '$user_password', '$first_name', '$last_name', '$business_name')";

 

$result=mysql_query($sql);

 

Link to comment
https://forums.phpfreaks.com/topic/168542-solved-insert-into-trouble/
Share on other sites

I apprieciate the responses guys.

 

I'll check phpMyAdmin with the query, Then my .swf where the vars are coming from.

 

I assume i can echo the mysql error and assign it to a var, such as

or die(echo "success= 'SQL Error' . mysql_error()");

as i can check "success" from my .swf if i echo as such

echo "success=yes";

Thanks for the help guys.

ended up the problem was not having quotes around my vars in my php file.

doh :facewall:

 

this works, but it was not what was in my php file.

 

$sql="INSERT INTO Clients(EmailAddress, UserPassword, FirstName, LastName, BusinessName)

VALUES('$email_address', '$user_password', '$first_name', '$last_name', '$business_name')";

 

$result=mysql_query($sql);

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.