this gives me error message: Subquery returns more than 1 row
"INSERT INTO customerbook (booking_ID,room_Type)
values((select booking_ID from bookings where booking_ID = bookings.booking_ID),'$a')"
any solution?
Hi!
OMG. Your query seems like a riddle to me, I mean bookings.bookin_id where booking_id=booking.booking_id. lol, dont you think it rhymes sort of..
Anyways, yes. What is happening here is your subquery which is
select booking_ID from bookings where booking_ID = bookings.booking_ID
returns more than one selection. Thereby the error subquery returns more than one value. That is your query results in more than one match for your condition
where booking_ID = bookings.booking_ID .
Try ifinding out your subquery result
$query = select booking_ID from bookings where booking_ID = bookings.booking_ID
$result = mysql_query($query);
$ans = mysql_fecth_assoc($resullt);
Try echoin the values and you ll know whats goin wron
Regards
CyberKing
www.bytesandbytes.com