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
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";

Link to comment
Share on other sites

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);

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.