Hey. I’m new here and I have a big problem with a page I am coding for my website. I will try my best to explain what I am trying to do without confusing anybody too much. Okay. I have created this page with pagination. Which is working great, 100%. The only problem now is I want to grab some data form a table, and am having trouble displaying it/grabbing it really, even. I have a table with 7 rows that have "item1 - item7. I can only figure out how to display one of them, so I chose to display the first one, item one. These are all in the table “trades”. In this I am using 3 different tables: trades, uitems and items. I have to resort to inserting all of the item data into the trade table (the item1 - item7 date), because I’m not sure how to grab the ids… I’m no where near new at programming, I’ve been a programmer for 10 years now. But some things confuse me. Anyhow, here is my code:
[php]<?php
session_start();
include(“configfile.php”);
?>
You are not Logged In! Please Login or Register to Continue!"; } if(isset($_SESSION['username'])) { $view = $_GET['view']; $offers = $_GET['offers']; $create = $_GET['create']; echo "$shownavbar$ubearTrade Center
Hello there, and welcome to the Trade Center! It is advised you be careful when trading, as other users may try to scam you.
Home | Create a Trade | View Trades | My Offers
"; if(isset($view)) { $per = 1; $thequer = mysql_query("SELECT COUNT(`tradeid`) FROM `trades`"); $pages = ceil(mysql_result($thequer, 0) / $per); $page = (isset($_GET['view'])) ? (int)$_GET['view'] : 1; $start = ($page - 1) * $per; $query1 = mysql_query("SELECT * FROM trades LIMIT $start, $per"); while($query = mysql_fetch_assoc($query1)) { ============$getuitemsquery = "SELECT * FROM uitems WHERE uitemid=$query[item1]"; $uitems = mysql_query($getuitemsquery); while($i1 = mysql_fetch_array($uitems)) { $itemt1 = $i1['theitemid']; } $nowitemq = "SELECT * FROM items WHERE itemid='$itemt1'"; $nowq = mysql_query($nowitemq); while($row = mysql_fetch_array($nowq)) { $image = $row['image']; $name = $row['name']; $desc = $row['description']; $rarity = $row['rarity']; } echo "
Owner: $query[user] |
$name |