logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > PHP
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 10-31-2011, 10:04 PM   #1
Austintxous
 
Join Date: Aug 2011
Location: Austin, Texas USA
Posts: 26
Default Query String: How to append the ID of a row of a newly inserted database row (PHP)?

OK, I can get the number of the last row created, as I do below. Now, I want to append it to the URL? query string so I can use this particular record on the next page. Here's the way I'm trying to do it, where the field iduserid is my primary key. If I just insert it into a text field on the page it displays the correct number. ( note: LastRec is a record set that contains the iduserid field of the current row)

But it doesn't return anything in the query string. What's wrong?
Code:
<?php
$result = mysql_query('SELECT iduserid FROM userinfo ORDER BY iduserid DESC LIMIT 1');
if (!$result) {
    die('Invalid query: ' . mysql_error());
}
$USER_ID = mysql_fetch_field($result,0);
?>

<a href="cp-AccountInfo.php?<?php echo $_SERVER['QUERY_STRING']?>"iduserid="<?php echo $USER_ID ?>""><div class="OKbtn"></div></a>
Austintxous is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:49 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com