Jump to content

Seancon1

New Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by Seancon1

  1. It was returning 0 rows simply because (silly me) the row with the ip wasn't my current. So it was searching for an ip that was not there. ;x
  2. I am unable to echo content in my mysql_fetch_array.. $query_sum = mysql_query("SELECT ip, cases, motherboards, cpu, video_cards, ram, power_supply, sound_cards, storage, media_player, cpu_cooling, monitor, accessories FROM sessions WHERE ip = '$ip'") or die(mysql_error()); while($get = mysql_fetch_array( $query_sum )) { $item1 = $get['cases']; $item2 = $get['motherboards']; $item3 = $get['cpu']; $item4 = $get['video_cards']; $item5 = $get['ram']; $item6 = $get['power_supply']; $item7 = $get['sound_cards']; $item8 = $get['storage']; $item9 = $get['media_player']; $item10 = $get['cpu_cooling']; $item11 = $get['monitor']; $item12 = $get['accessories']; $items = array("1" => "$item1", "2" => "$item2", "3" => "$item3", "4" => "$item4", "5" => "$item5", "6" => "$item6", "7" => "$item7", "8" => "$item8", "9" => "$item9", "10" => "$item10", "11" => "$item11", "12" => "$item12"); echo "Displaying: " . $item3; } echo "Displaying: " . $item3; Does not return anything, not even the "Displaying" text is displayed. I remember being able to echo like this in the past, why not now?
  3. Solved I found the solution, thank you for looking at my post anyways. <?php $items = array ( "1" => $item1, "2" => $item2, "3" => $item3 ); $items1 = $items['1']; echo "The item has been displayed \$items1 = $items1 <br />"; $k = 1; while($k < 4) { $prod_item_num = $items["$k"]; $unique_query1 = "SELECT * FROM product_db WHERE id = $prod_item_num"; echo $unique_query1; echo "<br />"; $k++; } ?> Displays: The item has been displayed $items1 = one SELECT * FROM product_db WHERE id = one SELECT * FROM product_db WHERE id = two SELECT * FROM product_db WHERE id = three
  4. <?php $item1 = "one"; $item2 = "two"; $item3 = "three"; $k = 1; while($k < 4) { $prod_item_num = "\$item" . $k; $unique_query1 = "SELECT * FROM product_db WHERE id = $prod_item_num"; echo $unique_query1; echo "<br />"; $k++; } ?> The above displays the following SELECT * FROM product_db WHERE id = $item1 SELECT * FROM product_db WHERE id = $item2 SELECT * FROM product_db WHERE id = $item3 I need the $item(1-3) values to echo what I made them. I've tried many different ways, none of which worked.
  5. Hey, I liked the idea that I could get some sort of feedback so.. I'd like you guys to check my personal website out and tell me what you think. http://templates.prestigecode.com/pc6-28-12/ It's a template that I am working on for my current live site.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.