this is how i am attempting to use it:
<?php
$post_title_edited=$post1 . "vs" . $post2;
$con2=mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name2")or die("cannot select DB");
// Create table
$create = 'CREATE TABLE '. $post_title_edited .'
(
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
user VARCHAR(30) NOT NULL,
user_post VARCHAR(2000) NOT NULL,
date VARCHAR(30) NOT NULL
)';
// Execute query
mysql_query($create,$con2);
echo $post_title_edited;
$query='SELECT LAST(id) as LastId FROM '.$post_title_edited.'';
$last=mysql_query($query);
echo $last;
?>
post1 and post2 are user inputs. the table is created and the first echo works. the second one does not. i suppose this may be a mad place to test this code as the table is empty, put i have tested it on a similar table with 5 entries and have gotten the same result,nothing. from the little i have been able to scoop up on google, im using it correctly. i even resorted to using bing on this one just in case google missed something. i cant seem to find a solid explanation of how to use this. thanks in advance.
regardless of the code, i would really just like an explanation of how last() or first() works, i’ve seen bits of other ways to find the first or last value of an sql column. but again those were explained rather poorly
Why not
ORDERandLIMIT: