|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi, I was wondering whether it would be possible to find out the value of a column of the latest insert and then select all the rows which have the same value in that, all in one query.
Unclear what I mean? Well, like this: 1. Find out value of column in latest entry 2. Select all rows with the same value as the latest entry I know how to do this in two calls, but wouldn't it be possible (and faster) to to do it in one call? Thanks! |
|
#2
|
|||
|
|||
|
|
|
#3
|
|||
|
|||
|
1. $lastinsert = mysql_insert_id(); 2. select * from yourtablename where yourid = $lastinsert ------------------ Good Good Study Day Day Up |
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > Combining multiple SELECTs |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|