how to insert data from select query

pika

New member
Local time
Today, 19:15
Joined
May 2, 2011
Messages
2
Hi all,

how can I solve this problem. I have 3 tables (location, BS, advertisement). and has made a query. I am new in ms access. This is my query:
PHP:
$sql1="SELECT a.promotion, l.phone
FROM location l, BS c, advertisement a
WHERE l.bs_id = c.bs_id
AND a.bs_id = c.bs_id
AND l.datesend = #$date1#
AND (l.datesend between a.startdate AND a.enddate)";

	$mobile = $_POST['l.phone'];
	$promo = $_POST['a.promotion'];
	
$sql="INSERT INTO message (Message, Mobile, DateTimeQueue, SentStatus) VALUES ('$promo','$mobile',date(),'P')";

after the results of the query I want to insert into another table (table message). how do I insert. I hope you can help. I get this error:
Code:
Notice: Undefined index: l.phone in C:\xampp\htdocs\add1.php on line 48

Notice: Undefined index: a.promotion in C:\xampp\htdocs\add1.php on line 49
 

Users who are viewing this thread

Back
Top Bottom