Jump to content

help please


spearchilduser

Recommended Posts

im trying to get it so that if a user accepts a job then some details from one tbale get inserted into nother table so a tracker can activate

the code im using is :

mysql_query("SELECT User_ID,User_Longitude,User_Latitude  INTO user_location FROM quotes) or die (mysql_error));

 

but im know its not of the correct format as im putting it in :

 

if($sql)
$msg = "Taxi Accepted sucessfully.";
      mysql_query("SELECT User_ID,User_Longitude,User_Latitude  INTO user_location FROM quotes) or die (mysql_error());
else
$msg = "Taxi not Accepted sucssfully try again.";
echo "$msg";

Link to comment
Share on other sites

if($sql)

{

      $msg = "Taxi Accepted sucessfully.";

      mysql_query("SELECT User_ID,User_Longitude,User_Latitude  INTO user_location FROM quotes) or die (mysql_error());

}

      else

      {

$msg = "Taxi not Accepted sucssfully try again.";

echo "$msg";

      }

still not working

Link to comment
Share on other sites

doesnt really explain the probelm with my statement thanks so

 

 

Actually it does. Read the syntax and read the page. MySQL does not support "SELECT INTO" sybase syntax, instead it is

 

INSERT INTO table_name (col1, col2) SELECT somecol1, somecol2 FROM table_name WHERE ....

 

If you are going to ask for help, actually look at the answers given before dismissing them.

 

So your statement, which was missing an ending quote should be from this:

mysql_query("SELECT User_ID,User_Longitude,User_Latitude  INTO user_location FROM quotes) or die (mysql_error));

 

To:

mysql_query("INSERT INTO user_location (id, longit, lat) SELECT User_ID,User_Longitude,User_Latitude FROM quotes") or die (mysql_error()));

 

You will need to change "id, longit, lat" to be what column names that data needs to go into.

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.