corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » PHP Help again - ASAP


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author PHP Help again - ASAP
James
Member

Registered: 1st Jun 02
Location: Surrey
User status: Offline
21st Mar 05 at 20:47   View User's Profile U2U Member Reply With Quote

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
21st Mar 05 at 23:18   View User's Profile U2U Member Reply With Quote

Did you run the $insert query?
James
Member

Registered: 1st Jun 02
Location: Surrey
User status: Offline
21st Mar 05 at 23:20   View User's Profile U2U Member Reply With Quote

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
21st Mar 05 at 23:22   View User's Profile U2U Member Reply With Quote

Can you echo() the $CustomerID ?
James
Member

Registered: 1st Jun 02
Location: Surrey
User status: Offline
21st Mar 05 at 23:23   View User's Profile U2U Member Reply With Quote

yup i did it comes up with "Resource id #8"
Laney
Member

Registered: 6th May 03
Location: Leeds
User status: Offline
21st Mar 05 at 23:30   View User's Profile U2U Member Reply With Quote

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]

 
New Topic

New Poll

Corsa Sport » Message Board » Off Day » PHP Help again - ASAP 23 database queries in 0.0071580 seconds