James
Member
Registered: 1st Jun 02
Location: Surrey
User status: Offline
|
Trying to pull the customer ID from a database and store it in a different table in the same database.
This is the code i have, ive echoed the insert to see what happens and it seems to think that $CustomerID = ResourceID#8
$GetCustomerID="Select CustomerID
From Customer
where Email =\"".$_POST['strEmail']."\"";
$CustomerID = mysql_query($GetCustomerID, $connection);
$Insert='insert into Orders
set CustomerID ="'. $CustomerID.'",
Product ="'. $tempArray[$i][1].'",
Quantity ="'. $tempArray[$i][3].'",
Price ="'. $tempArray[$i][2].'",
ProductID="'. $tempArray[$i][0].'"';
[Edited on 21-03-2005 by James]
|
Laney
Member
Registered: 6th May 03
Location: Leeds
User status: Offline
|
Did you run the $insert query?
|
James
Member
Registered: 1st Jun 02
Location: Surrey
User status: Offline
|
yup thats a bit further down, its puts all the data in except the customer id
|
Laney
Member
Registered: 6th May 03
Location: Leeds
User status: Offline
|
Can you echo() the $CustomerID ?
|
James
Member
Registered: 1st Jun 02
Location: Surrey
User status: Offline
|
yup i did it comes up with "Resource id #8"
|
Laney
Member
Registered: 6th May 03
Location: Leeds
User status: Offline
|
quote: Originally posted by Laney
Can you echo() the $CustomerID ?
Thats me not reading then 
$sql= "SELECT CustomerID FROM 'Customer' WHERE 'Email' == '".$_POST['strEmail']."';
Maybe? 
Edit: Or try assigning the $email variable before putting into the query? It might make it look a bit less messy 
[Edited on 21-03-2005 by Laney]
|