flemingmike Posted September 23, 2010 Share Posted September 23, 2010 hello, here is what i have, obviosly it doesnt work. $year=$_POST['y']; $yr=substr($year,-2); $mth=$_POST['m']; $init=$_POST['initial']; $jobnumber=$yr$mth2343$init; echo "$jobnumber"; P.S. thanks to everybody for their help lately! Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted September 23, 2010 Share Posted September 23, 2010 $new_str = $str1 . $str2 . $str3; Quote Link to comment Share on other sites More sharing options...
flemingmike Posted September 23, 2010 Author Share Posted September 23, 2010 thanks. 1 other thing, if i post to mysql and i have a field that is an auto incremental number, and i want show the following: echo "Posted successfully. the id for this post is $id"; how would i get the id for what i just posted? Quote Link to comment Share on other sites More sharing options...
Miss_Rebelx Posted September 23, 2010 Share Posted September 23, 2010 Do you mean just doing this: //Assuming the table name is 'post' and the field containing the post ID is 'id'. $result = mysql_query("SELECT id FROM post;"); $id = mysql_result($result, 0); Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted September 23, 2010 Share Posted September 23, 2010 mysql_insert_id() is what you're looking for. Quote Link to comment Share on other sites More sharing options...
flemingmike Posted September 23, 2010 Author Share Posted September 23, 2010 so can i do $id=mysql_insert_id(); Quote Link to comment Share on other sites More sharing options...
Miss_Rebelx Posted September 23, 2010 Share Posted September 23, 2010 According to this: http://php.net/manual/en/function.mysql-insert-id.php You can. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.