I writing some PHP doing stuff to a database, in which I have a table like this...
CREATE TABLE MYTABLE (
something TINYTEXT,
another VARCHAR(16),
created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
userID INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY (userID),
);
And I write some PHP like this...
$sql_result=mysql_query("INSERT INTO MYTABLE VALUES ('hello','world');");
Will $sql_result hold anything useful for an INSERT statement?
Like the record I just inserted? (So $sql_result is an array of records with length 1 - provided everything works).
That would be really useful to me, because I'd like to obtain the userID value, right after the insert, without going through a second query.
CREATE TABLE MYTABLE (
something TINYTEXT,
another VARCHAR(16),
created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
userID INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY (userID),
);
And I write some PHP like this...
$sql_result=mysql_query("INSERT INTO MYTABLE VALUES ('hello','world');");
Will $sql_result hold anything useful for an INSERT statement?
Like the record I just inserted? (So $sql_result is an array of records with length 1 - provided everything works).
That would be really useful to me, because I'd like to obtain the userID value, right after the insert, without going through a second query.