PHP - Display Sql Data By Clicking List
I am brand new to PHP but, after using W3 Schools, can retrieve a record from a MySQL database using php & SQLi.
I have a page with a list of between 20 and 30 items down one side and a panel on the other. When a user clicks a list item I want to display the details of the clicked item in the panel. The details a Program (text), Convenor (text), Dates (text), Times (Text), Location (text), Notes (Text large).
The details are stored in a MySQL Database 'Documents', in a table 'Programs' and I would like to put the details into text boxes in the panel.
Could you point me to some info on doing this please?
Thanks
Similar Tutorialsplease help me the concept or code to retrive data from the database and display data according to the data from the dynamic list box option. I have no clue about to go abt this one: I have form which has some: Code: [Select] <table> <tr> <td> <form> Title display info </form> </td> </tr> </table> I need to add an additional link next to title such that when someone clicks on the link the table expands and displays rsult of a query. Code: [Select] <table> <tr> <td> <form> Title LINK if( link is clicked ) { $query=select display query results } else { dont display query results display info } </form> </td> </tr> </table> here my sample code <form> <input id="query" type="text" name="query" placeholder="search here..." autocomplete="off"> <button type="submit" value="query" >search</button> <div class="sugbx"></div> </form> //php code, assume we already run a whole php code ...... <ul class="list-group list-unstyled" style="cursor:pointer; color: #191919; position:absolute; top:12px;"> <?php foreach($query as $movie) { ?> <li class="list-group-item" onClick="searchValue('<?php echo $movie["movie_name"]; ?>'),;"><?php echo $movie["movie_name"]; ?></li> <?php } ?> </ul> <?php } ?> //ajax here $('#search').keyup(function(){ $.ajax({ type: 'GET', url: 'phpcode.php', data:'query='+$(this).val(), success: function(data){ $('.sugbx').show(); $('.sugbx').html(data); } }); }); function searchValue(val) { $('#query').val(val); $('.sugbx').hide(); } //ajax the input accept the value only after selecting one of the listed value on the suggesstion box and then i have to click the submit button the problem is, how to submit the value accepted when a list is clicked The subject could be a bit vague, but my problem is simple. (I think so) So I made a php test site that is quite similar to a forum. Where you see a title or a subject and when you click on it you will see more details about that subject. I made my database and script for inserting data into my mySQL database. I also did my output aswell, so every topic is posted on a webpage "archive" where you can see all the subjects. But now I want to see the full details of that type of subject by clicking on it. I have no idea how to make that happen googled it but didn't find any results...just wondering if it's even possible to do that. I'm a new guy here! I'm pulling data from an xml file and I'm getting a lot of duplicates. How can I remove the duplicates from the query? Code: [Select] foreach($xml->category->subcategory as $category){ echo $category[id]; }//end foreach I have a drop down list which retrieves site name acronym and the url from the database. I need help in 2 things. 1.I do not want the url to be displayed in the drop down list. 2. When I hit submit I need to echo the sitename acronym as well as the url in a page called display.php. Here is my code so far: Code: [Select] <form action="display.php" method ="post"> <tr> <td>Category</td> <td> <select name="new_id"> <option value="">=============</option> <?php foreach($acronym as $key=>$value){ ?> <option value="<?php echo $value['site_id']; ?>"><?php echo $value['acronym']; ?></option> <option value="<?php echo $value['site_id']; ?>"><?php echo $value['url']; ?></option> <?php }?> </td> </tr> <input type="submit" name="submit" value="submit" /> </form> I have several forms which will request the user to select one of several options where the most common choices will be pronounced, and might look something like: Select Option A Select Option B Select Option C Select Option D Click here for more choicesThe client is responsible to determine which ones to display (opposed to hiding within "more choices") and the server is responsible to provide the list of options along with some means to determine which ones are most common. For a new user, the order will be based on my "best guess", however, whenever a user selects a given option its ranking for that user only should go up, and in addition more recent activities should have more bearing on the returned order. In addition, there will be more than one of these lists and each of these lists will expose a public identifier (most will use a string but some might use an incrementing integer series) instead of the primary key. I have some fragmented ideas how to best implement but would like other people's thoughts on how to best do so. Starting with the list schema, undecided on which approach below. Any preferences or something else altogether? Solution 1: abstract_list - id (INT PK) - discriminator (string) - name (string unique with discriminator) - ranking (TBD whether float or integer. This represents my initial "best guess") list1 (list2, etc) - id (FK to abstract_list.id) - discriminator (FK to abstract_list.discriminator) - public_id (string or integer based on specific list. unique with discriminator) Solution 2: abstract_list - id (INT PK) - discriminator (string) - name (string unique with discriminator) - ranking (TBD whether float or integer. This represents my initial "best guess") - public_id (Application responsible to cast as string or integer. unique with discriminator) list1 (list2, etc. This class has no properties and only a method to cast the public ID as required. Seems like a waste...) - id (FK to abstract_list.id)
user_list_ranking - abstract_list_id - user_id - ranking (TBD) To retrieve the list options, will query abstract_list and LEFT JOIN user_list_ranking and then sort on some mathematical formula acting on abstract_list.ranking and COALESCE(user_list_ranking.ranking, 0). To promote recent activity, maybe increment user_list_ranking.ranking every time the user selects a given option and also decrement all other options of the associated list. To prevent excessive windup, cap the the value to some max value (i.e. If list1 has a total of 10 records, cap it three times that value resulting in 30), and cap the minimum at zero. Uncharted territory here and am very open to other approaches. I am undecided whether I should just return an ordered array of the options, or also include either an order integer or some normalized value from 0 to 1. If there is a common way to do this, please let me know what it is so I may mimic it. If not, please provide any critique or recommended changes to my intended approach. Thanks Hi everyone, im looking for some help if anyone can offer it. I currently run a phpbb Playstation3 gaming forum and was looking for a way to show forum members online status info on a seperate page on my forum. I found some php script that pulls the freinds list data from the URL mentioned in the code, for now it only works on my local host and i get errors when trying to run it from my live server. here is the current code: Code: [Select] <?php error_reporting(E_ALL); libxml_use_internal_errors(true); $fp = fopen("curl_log.txt",'a+'); //Logging purposes only $dataURL = "https://secure.eu.playstation.com/ajax/mypsn/friend/presence"; $loginURL = "https://store.playstation.com/external/login.action?returnURL=https://secure.eu.playstation.com/sign-in/confirmation"; $cc = curl_init(); getData(); function getData() { global $cc,$fp,$dataURL; curl_setopt ($cc, CURLOPT_URL, $dataURL); curl_setopt ($cc, CURLOPT_POST, 0); curl_setopt ($cc, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($cc, CURLOPT_FOLLOWLOCATION, 1); curl_setopt ($cc, CURLOPT_USERAGENT, 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7'); curl_setopt ($cc, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt ($cc, CURLOPT_REFERER, $dataURL); curl_setopt ($cc, CURLOPT_VERBOSE, 1); curl_setopt ($cc, CURLOPT_STDERR, $fp); curl_setopt ($cc, CURLOPT_COOKIEFILE, 'cookie.txt'); $output = curl_exec($cc); $xml = simplexml_load_string($output); if (!$xml) { login(); } else { // Here you will have a simpleXML object that you can do with as you please - example output below. foreach($xml->psn_friend as $friend) { $img_loc = str_replace("//", "/", $friend->current_avatar); echo "<img src=\"https://secure.eu.playstation.com".$img_loc."\"/> "; echo "<font color=\"red\">$friend->onlineid</font> <br />"; echo "Status : ".$friend->current_presence."<BR />"; echo "Game : ".$friend->current_game."<BR />"; echo "Comment : ".$friend->Comment."<BR />"; echo "<BR /><BR />"; } curl_close($cc); fclose($fp); } } function login() { global $cc,$loginURL; curl_setopt ($cc, CURLOPT_URL, $loginURL); curl_setopt ($cc, CURLOPT_POST, 1); curl_setopt ($cc, CURLOPT_POSTFIELDS, 'loginName=<username@user.com>&password=<password>'); curl_setopt ($cc, CURLOPT_COOKIEJAR, 'cookie.txt'); curl_exec($cc); getData(); } ?> The error i mentioned above is related to the Code: [Select] curl_setopt ($cc, CURLOPT_FOLLOWLOCATION command, im not to concerned about that at the moment. Im looking for someone to help me with the actually XML object, its very basic and i would, if poss, love to have it looking like the actual PSN freinds list. Here are images of this codes output and the actuall Freinds list. Codes Ouput: Actuall PSN FR: Would it be possable to actually grab the exact image from the actuall playstation site, as above? or could the online/offline icons be added to the above code with a background image? I hope i have explained the above clearly, if theirs any thing anyone is unsure of please dont hesitate to ask. Hopefully someone can help. Thanks, Lee Hello, I have been developing a website that needs to display products online, I was originally going to hand-write the PHP code but I thought it would be more beneficial to make it database orientated as new products can easily be added and a search function becomes possible. I have it working so far so good, but the last part I can't seem to get working. I have it so all the products that have the desired category are displayed, but I want a more detailed analysis of the product to appear when the image is clicked, which at the moment, displays a blank page. http://www.webwib.co...?p=floorpuzzles - this is the hand coded version that demonstrates how I want it to work. http://www.webwib.co...hp?floorpuzzles - this is the db version so far, it works how it is intended to apart from the last stage, which returns as a blank page rather than a dedicated page for the selected product. Here is my code, the third segment beginning with "if(isset($_GET['$ID'])){", is my attempt at the final stage. <?php $db=mysql_connect ("localhost", "webwibco_charlie", "Hello123") or die ('I cannot connect to the database because: ' . mysql_error()); $mydb=mysql_select_db("webwibco_products"); include("header.php"); if(isset($_GET['floorpuzzles'])){ echo "<h1>Our Floor Puzzles</h1>"; $sql="SELECT ID, Name, Tags, Description, Category FROM products WHERE Category LIKE '%" . FloorPuzzles . "%'"; $result=mysql_query($sql); while($row=mysql_fetch_array($result)){ $Name =$row['Name']; $ID =$row['ID']; $Description =$row['Description']; echo "<div class=\"box\">"; echo "<h1>$Name</h1>"; echo "<div class=\"floorbox\"><a href=\"?$ID#productspage\"><img src=\"images/products/catalogue/$ID.jpg\" class=\"small\"></a></div>"; echo "<h2>$Description</h2>"; echo "</div>"; } } if(isset($_GET['anothercategory'])){ $sql="SELECT ID, Name, Tags, Description, Category FROM products WHERE Category LIKE '%" . AnotherCategory . "%'"; $result=mysql_query($sql); while($row=mysql_fetch_array($result)){ $Name =$row['Name']; $ID =$row['ID']; $Description =$row['Description']; echo "<h1>Our Floor Puzzles</h1>"; echo "<div class=\"box\">"; echo "<h1>$Name</h1>"; echo "<div class=\"floorbox\"><a href=\"?$ID0#productspage\"><img src=\"images/products/catalogue//$ID.jpg\" class=\"small\"></a></div>"; echo "<h2>$Description</h2>"; echo "</div>"; } } if(isset($_GET['$ID'])){ $sql="SELECT ID, Name, Tags, Description, Peices, Size, Barcode, Category FROM products WHERE ID LIKE '%" . $ID . "%'"; $result=mysql_query($sql); while($row=mysql_fetch_array($result)){ $Name =$row['Name']; $ID =$row['ID']; $Description =$row['Description']; $Pieces =$row['Pieces']; $Size =$row['Size']; $Barcode =$row['Barcode']; echo "<div class=\"1\">"; echo "<h1>$Name</h1>"; echo "<div class=\"bigbox\">"; echo "<div class=\"floorbox\"><img src=\"images/products/catalogue/$ID.jpg\" class=\"big\"></div>"; echo "</div>"; echo "</div>"; echo "<div class=\"2\">"; echo "<p>Puzzle Pieces: $Pieces</p> <p>Puzzle Size: $Size</p> <p>Barcode $Barcode</p>"; echo "</div>"; } } include("footer.php"); ?>Thank you in advance for any assistance given. I have a mysql table with the structure of Code: [Select] ID Menu_Name Parent_ID 1 Finance NULL 2 Business NULL 3 Investment 1 4 Trading 2 How can I create a html <ul><li> list based on the parent? Hi pals, I got a complex Array from the Query. it's Structure is like Quote Array ( => Array ( [server_name] => anes.admod.net [id] => 1 [server_id] => 1 [description] => nice Anes Server [status] => 0 [max_down_count] => 9 [check_interval] => 15 [fail_recheck] => 6 [log_retain] => 1 [warning] => 12 [critical] => 15 [timeout] => 8 [audible] => Y [email] => Y [im] => Y [sms] => Y [rss] => N [rssid] => [vcare] => Y [created] => 2010-12-06 10:26:26 [last_update] => 2010-12-13 16:41:48 [name] => POP3 [port] => 110 [okay] => OK [warn] => WARNING [crit] => CRITICAL [down] => Connection refused [advanced] => N [typestatus] => 1 ) [1] => Array ( [server_name] => neseema.admod.net [id] => 2 [server_id] => 2 [description] => another server [status] => 1 [max_down_count] => 11 [check_interval] => 15 [fail_recheck] => 12 [log_retain] => 2 [warning] => 12 [critical] => 16 [timeout] => 6 [audible] => Y [email] => Y [im] => Y [sms] => N [rss] => N [rssid] => [vcare] => N [created] => 2010-12-07 10:27:42 [last_update] => 2010-12-13 16:41:48 [name] => Cpanel [port] => 2082 [okay] => OK [warn] => WARNING [crit] => CRITICAL [down] => Connection refused [advanced] => N [typestatus] => 1 ) [2] => Array ( [server_name] => anes.admod.net [id] => 3 [server_id] => 1 [description] => nice Anes Server another Service [status] => 1 [max_down_count] => 14 [check_interval] => 15 [fail_recheck] => 3 [log_retain] => 3 [warning] => 12 [critical] => 16 [timeout] => 18 [audible] => Y [email] => [im] => [sms] => [rss] => N [rssid] => [vcare] => N [created] => 2010-12-07 12:58:01 [last_update] => 2010-12-13 16:41:48 [name] => SMTP [port] => 25 [okay] => OK [warn] => WARNING [crit] => CRITICAL [down] => Connection refused [advanced] => N [typestatus] => 1 ) ) In this Result I have 2 Rows in result to show, I mean I need to merge the data of First (0th) and Third(2nd) element because it display the data of same item. So How it can done, I am working in that whole day but not get a solution fully.... I saw a near solution like : <?php $input = array( 0 => array ( 'id' => 160, 'payment_period' => 'Monthly', 'plan_payment_type_id' => 171, 'payment_type_id' => 4), 1 => Array ( 'id' => 160, 'payment_period' => 'Monthly', 'plan_payment_type_id' => 172, 'payment_type_id' => 5), 2 => Array ( 'id' => 161, 'payment_period' => 'Weekly', 'plan_payment_type_id' => 173, 'payment_type_id' => 9), ); echo "<pre>"; print_r($input); echo "</pre>"; echo "****************************************************************************"; $output = array(); $id_array = array(); $i = 0; foreach($input as $key=>$val) { if(array_key_exists($val['id'],$id_array)) { $pos = $id_array[$val['id']]; $output[$pos]['payment_types'][] = array('plan_payment_type_id'=> $val['plan_payment_type_id'],'payment_type_id' => $val['payment_type_id']); } else { $output[$i] = array('id' => $val['id'],'payment_period' => $val['payment_period'],'payment_types' => array(array('plan_payment_type_id'=> $val['plan_payment_type_id'],'payment_type_id' => $val['payment_type_id']))); $id_array[$val['id']] = $i; $i++; } } echo "<pre>"; print_r($output); echo "</pre>"; ?> But I cannot handle it nicely, please give any sample or helping code idea for same , waiting your immediate Reply Thankfully Anes P.A Hi, I am hoping someone can help me out with a slight issue I have with php and mySQL. I have an ajax-powered form with a select (dropdown) field populated through a php function. Based on the user-selected values in this field, data is displayed on the webpage; i.e. selected value 1 returns values x and y on the page. I am now trying to call additional data (value z) from a different table in the same database, and as before, use the selected values from the dropdown to display the data. For some reason, value z is not changing according to the user-selected value. This is my code: [The function to populate the select field] Code: [Select] function kfl_get_funds_names() { $result = array(); $result['CDF'] = 'Crosby Dragon Fund'; $result['CPF'] = 'Crosby Phoenix Fund'; $result['AMZPIF'] = 'AMZ Plus Income Fund'; $result['KASBIIF'] = 'KASB Islamic Income Opportunity'; $result['KASBCPGF'] = 'KASB Capital Protected Gold Fund'; $result['KASBLF'] = 'KASB Income Opportunity Fund'; $result['KASBCF'] = 'KASB Cash Fund'; $result['KASBBF'] = 'KASB Asset Allocation Fund'; $result['KASBSMF'] = 'KASB Stock Market Fund'; return $result; } [the code calling and using the function to interact with the database] Code: [Select] $funds_to_display = kfl_get_funds_names(); $current_symbol = key( $funds_to_display ); $current_nav_rates = kfl_get_latest_rates( $current_symbol ); [the code calling additional data, value z, from the database, and using the info in the select field to filter it] Code: [Select] $cutoff = kfl_cutoff( $current_symbol ); The display of each of these items is as follows: Code: [Select] <?php echo $current_nav_rates['nav_date']; ?> <?php echo $funds_to_display[$current_symbol]; ?> <?php echo $cutoff['cutoff']; ?> I can't get the $cutoff code to display the correct values. It picks up the first symbol to display and doesn't change with user selection. The code for the selection box, by the way: Code: [Select] <select id="dailynav-funds" autocomplete="off" name="dnf"> <?php foreach ($funds_to_display as $fund_symbol => $fund_name) { echo '<option'; if( $fund_symbol == $current_symbol ) { echo ' selected="selected"'; } echo ' value="' . $fund_symbol . '">'; echo $fund_name; echo '</option>'; } ?> </select> I've tried to get data using $_GET['dnf'] into the cutoff code, but that throws up parse errors. What am I doing wrong, and how can I resolve this issue? Thanks in advance! I have a form created with code already written. I am in need of a push in the right direction or a potential tutorial on this issue i have. I am running a fanatsy golf website where the user will pick one golfer each week and the cannot select them again. Is there a way I can remove that data from the list for the next week when the user makes his selection or can I have that data another color and unselectable. If you want code, please let me know and i can provide it. Thanks in advance for your help. p.s. the list data is stored in a MySQL database. Hi? im just a beginner in php i just want to ask how to insert a data into a table from a dropdown list. I have concatenate the itemid and description to form the dropdown list. But when i viewed my item_table the itemid and description columns are null. can you help me with this.. this is my php code for the dropdown list... <?php $query = "SELECT CONCAT(itemid,' ', '-',' ', description) AS Item FROM item_table"; $result = mysql_query($query) or die(mysql_error()); $dropdown = "<SELECT CONCAT(itemid,' ' '-',' ', description) AS Item FROM item_table>"; while($row = mysql_fetch_assoc($result)) { $dropdown .= "\r\n<option value='{$row['Item']}'>{$row['Item']}</option>"; } $dropdown .= "\r\n</select>"; echo $dropdown; ?> this my code for inserting data into the item_table... <?php if(isset($_POST ['submit'])) { $itemid = $_POST['itemid']; $description = $_POST['description']; $datein = $_POST['datein']; $qtyin = $_POST['qtyin']; $unitprice = $_POST['unitprice']; $unit = $_POST['unit']; $category = $_POST['category']; $empid = $_POST['empid']; $message =''; if(($itemid && $description == "")||($itemid && $description == null)) { header("location:IncomingEntry.php?msg=Incorrect"); exit(); } else { $link = mysql_connect('localhost', 'root', '') or die(mysql_error()); $db_selected = mysql_select_db('inventory', $link); $message=''; $query = "INSERT INTO incoming_table (itemid , description, datein, qtyin, unitprice, unit, category, empid) VALUES ('".$itemid."', '".$description."', '".$datein."', '".$qtyin."', '".$unitprice."', '".$unit."', '".$category."', '".$empid."')"; if (!mysql_query($query,$link)) { die('Error: ' . mysql_error()); } header("location: IncomingEntry.php?msg=1 record added"); } } ?> I am getting an error on line 3 for the original code, so I need help there, but what I do have a question on is this: http://kaboomlabs.com/PDI/test2.php Code: [Select] <?php $dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME) $result = $mysqli_query("SELECT * FROM comp"); echo "<SELECT name='comp'>\n"; while($row = $result->fetch_assoc()) { echo "<option value='{$row['name']}</option>\n"; } echo "</select>\n"; $result_close(); ?> What I am attempting to do is two fold. 1. Using PHP create a pull down menu that grabs data from the database. 2. Have something in where after line three there is a dotted break, and then the rest of the list is shown. There are over 150 entities that go into this database, so the top 3 are going to be the most used, the rest are going to be in alphabetical order. Now the database has a auto-increment numbering system, the company name, address, phone number, and email if possible. I only want it to show the company name. Is this possible at all? Hey guys, I can't wrap my head around how to make this work right... I have three tables: Code: [Select] CREATE TABLE `games` ( `g_id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(150) DEFAULT NULL, PRIMARY KEY (`g_id`)); CREATE TABLE IF NOT EXISTS `game_player` ( `r_id` int(11) NOT NULL AUTO_INCREMENT, `p_id` int(11) DEFAULT NULL, `g_id` int(11) DEFAULT NULL, `bool` int(1) NOT NULL DEFAULT '0', PRIMARY KEY (`r_id`)); CREATE TABLE IF NOT EXISTS `players` ( `p_id` int(11) NOT NULL AUTO_INCREMENT, `playerid` varchar(150) NOT NULL, PRIMARY KEY (`p_id`), UNIQUE KEY `playerid` (`playerid`)); The players table is my list of users, and they're tied to the list of games via the game_player table. So here's my issue... I'm trying to show the full list of games, and then check mark each record where the player does play it. This is what I have so far - it shows all the games, but it's not checking the boxes. Code: [Select] $result = mysql_query("SELECT * FROM games") or die(mysql_error()); while($row = mysql_fetch_array($result)) { $newquery = "SELECT * FROM game_player, players WHERE game_player.p_id = players.p_id AND game_player.g_id = ".$row['g_id']. " AND players.playerid = {$userid}"; $query = mysql_query($newquery) or die(mysql_error()); if($query['bool'] == 1) { $set_checked = " CHECKED"; } else{ $set_checked = ""; } echo "<input type=\"checkbox\" name=\"box1\" value=\"".$query['g_id']."\"" . $set_checked . "/>".$row['name']."<br />\n"; } Hello. What I have created is a menu with links. The links will display content on the page from a database. I have the links with id displayed, but nothing is displayed when the link is clicks. I have seen isset() and $_GET used but not a form and I don't know how to change the code to allow the display of data using ID. My site is local, and I am using XAMPP. The database connections work. This is my code: // query $query = "SELECT * FROM topmenu ORDER BY id ASC"; $row = $PDO->query($query); .... <table class="topmenu"> <tr> <td> <h1 class="siteName">site title</h1> </td> <?php foreach($row as $data) { ?> <td><a href="index.php?id=<?php echo $data['id']; ?>"> <?php echo $data['menuheader']; ?> </a></td> <?php } ?> </tr> </table> As a beginner, I would appreciate any help, no criticism of my code please! Also, is there a way of hiding the id in the url? Thanks in advance. Hi all. The following is a function to get and display data. However, I've hit a wall in my progress. It's only printing out one field. I need to have it print out every retrieved field. Any help is appreciated. function get_data($table_name){ $result=mysql_query("SELECT * FROM $table_name"); $num=mysql_num_rows($result); $i=0; while($i < $num){ $fields=mysql_fetch_field($result,$i); $display_fields=mysql_result($result,$i,$fields->name); echo $display_fields; $i++; }; }; I realized that (I think) I need the $display_fields var to be concatenated with the $i variable so there's a unique var name for each field retrieved from the mysql_fetch_field line. Any ideas? Hello, I just reach the ultimate high in frustration because i can not display all the data from my database in a table using php. Im trying to display all the members from my database (id, username, email and account type) in my admin cp, and what is happening is that i am displaying all my data in one td. (Ex, in the <td></td>, it will display all the usernames at once, rather than separating them). Code: [Select] <?php include_once "../config.php"; include_once "admin_check.php"; $get_members = mysql_query("SELECT * FROM members ORDER BY id"); while ($row = mysql_fetch_array($get_members)) { $id .= $row['id']; $username .= $row['username']; $account_type .= $row['account_type']; $email .= $row['email']; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Welcome Admin!</title> </head> <body> <h1>Welcome admin! <a href='../index.php'> Click here to go back! </a></h1> <table cellspacing="5" cellpadding="5" style="border: black thin solid" align="center"> <tr> <td>ID</td> <td>Username</td> <td>Email</td> <td>Account Type</td> </tr> <tr> <td><?php echo $id;?></td> <td><?php echo $username;?></td> <td><?php echo $email;?></td> <td><?php echo $account_type;?></td> </tr> </table> </body> </html> Now i tried making the table in the while loop, but i am also having the same problem. Please help. |