monkeybidz Posted November 11, 2007 Share Posted November 11, 2007 The following code only gets user and title from database, but does not get the rest. They do exsist in database. $query = "select * from PHPAUCTIONREVERSE_auctions where id=".intval($_REQUEST[id]); $result = mysql_query($query); if ( !$result ) { print "aki 3"; exit; MySQLError($query); exit; } $user = stripslashes(mysql_result ( $result, 0, "user" )); $title = stripslashes(mysql_result ( $result, 0, "title" )); $origin_zip = mysql_result($result, 0, "origin_zip"); $destination_zip = mysql_result ( $result, 0, "destination_zip" ); $pickup_date = mysql_result ( $result, 0, "pickup_date" ); $delivery_date = mysql_result ( $result, 0, "delivery_date" ); $origin_type = mysql_result ( $result, 0, "origin_type" ); $destination_type = mysql_result ( $result, 0, "destination_type" ); $city_details1 = mysql_result( $result, 0, "city_details1" ); $state1 = mysql_result ( $result, 0, "state1" ); $city_details2 = mysql_result ( $result, 0, "city_details2" ); $state2 = mysql_result ( $result, 0, "state2" ); $miles = mysql_result ( $result, 0, "miles" ); Quote Link to comment Share on other sites More sharing options...
PHP_PhREEEk Posted November 11, 2007 Share Posted November 11, 2007 Please, after 165 posts, could you please use the BBCode format for posting code? Anyways, try this and post the results: $query = "select * from PHPAUCTIONREVERSE_auctions where id=".intval($_REQUEST[id]); $result = mysql_query($query); if ( !$result ) { print "aki 3"; exit; MySQLError($query); exit; } $row = mysql_fetch_array($result); echo "<pre>"; print_r($row); die("</pre>"); PhREEEk Quote Link to comment Share on other sites More sharing options...
monkeybidz Posted November 11, 2007 Author Share Posted November 11, 2007 That only gave me full print of the entire row in my php page. My php page includes an html page. I just need to get the variable from db and print in html page. Quote Link to comment Share on other sites More sharing options...
PHP_PhREEEk Posted November 11, 2007 Share Posted November 11, 2007 You said only user and title is returned. I posted code to see exactly what all is being pulled. If it's all there, then do this: $row = mysql_fetch_array($result); $user = stripslashes($row['user']); $title = stripslashes($row['title']); $origin_zip = $row['origin_zip']; $destination_zip = $row['destination_zip']; etc, etc... PhREEEk Quote Link to comment Share on other sites More sharing options...
monkeybidz Posted November 11, 2007 Author Share Posted November 11, 2007 I tried that already, but when I add the following code to the html include page to echo or print the variable, I get nothing. User and title print fine. <? print $city_details1; ?> Quote Link to comment Share on other sites More sharing options...
PHP_PhREEEk Posted November 11, 2007 Share Posted November 11, 2007 Well, at this point then, we go to the obvious. post the code... PhREEEk Quote Link to comment Share on other sites More sharing options...
monkeybidz Posted November 11, 2007 Author Share Posted November 11, 2007 DOPE!!!!! There was nothing wrong, turns out I added the new fields to DB after items had already been inserted to DB. Last input was ID 19. When I tried to look at that item on site, the information did not exsist for this item, but when I looked at all newer items ID's 20 and up everything looks good. By the way your code also worked when viewing the updated items. Thanks for your help. 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.