lil_bugga Posted May 18, 2009 Share Posted May 18, 2009 I'm trying to display the data from inside one of my database tables using the code below, but all I'm getting returned is white space. Any ideas?, I have the connection to the database all set up correctly too // sets up queries $get_data_qry = "SELECT id, subcat_id, item_title, item_price, item_desc, item_image FROM store_items ORDER BY id"; // sets up query calls $get_data_res = mysqli_query($mysqli, $get_data_qry) or die(mysqli_error($mysqli)); //get and show 1st level navigation if (mysqli_num_rows($get_data_res) < 1) { $display_content = "<p><em>Sorry, no categories to browse.</em></p>\n"; } else { while ($data = mysqli_fetch_array($get_data_res)) { $id = $cats['id']; $subcat_id = $cats['subcat_id']; $item_title = ucwords(stripslashes($cats['cat_title'])); $item_price = $cats['item_price']; $item_desc = $cats['item_desc']; $item_image = $cats['item_image']; $display_content .= "blah ".$id."<br />\n ".$subcat_id."<br />\n ".$item_title."<br />\n ".$item_price."<br />\n ".$items_desc."<br />\n ".$item_image; } } Below is the table i'm selecting from, i haven't listed the image coloumn to save time id subcat_id item_title item_price item_desc 1 1 Mens Vest Top 4.00 A sleeveless vest top, ideal for those hot summer ... 2 1 Mens Short Sleeved T-shirt 5.00 A short sleeved, round neck T-shirt. 3 1 Mens Long Sleeved T-shirt 7.00 A long sleeved, round neck T-shirt. 4 1 Mens Hoodie 10.00 Made of thicker material to keep the heat in the h... 5 1 Mens Reversable Rugby Shirt 20.00 A reversable rugby shirt that shows a white stripe... Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted May 18, 2009 Share Posted May 18, 2009 Change all your $cats to $data Quote Link to comment Share on other sites More sharing options...
lil_bugga Posted May 18, 2009 Author Share Posted May 18, 2009 Change all your $cats to $data Cheers, i dunno how I missed them, bin trying to get it working a good half hour an its right under my nose , its always the way Thanks again 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.