PHP - Need Help With Xml Data To Populate Tables...
Hey everyone.
I have some experience with PHP and can easily modify existing code, but seem to have trouble writing the logic from scratch. Situation: I'm using this Jquery slider ( http://mine.tuxfamily.org/?p=74#more-74 ) and would like to populate the slides with data coming from an XML file. The data will be text, images(URIs), and links to buy. The thing is, each slide will hold 4 items, and then I want to somehow using PHP logic, allow the code to generate the next slide... In other words, how would I code it so that after 4 entries, it creates a new slide? I'm imagining a For loop + SimpleXML functions... but just kind of fumbling in the dark here. Any direction or guidance is greatly appreciated! Kind regards, Dey Similar TutorialsI have a form which creates a drop down list from data in a MySQL database. I would like to be able to have data from my database automatically populate based upon the selection from the list. How can I do that? Javascript? AJAX? Any help would be appreciated. Code: [Select] <?php $query2="SELECT tournament,id FROM 2011_Tournament"; $result2=mysql_query($query2); echo "<select name=2011_Tournament value='tournament'>Tournament</option>"; while($tournament=mysql_fetch_array($result2)){ echo "<option value='$tournament[tournament]'>$tournament[tournament]</option>"; } echo "</select>";?> Hello I am after some help with a concept to allow us to import some data into our database. I have a PDF which I have OCR'd and now have a word document... I then manually clean up the document to remove spurious characters, that part is fine. Now, the word document contains an unknown number of lines and an unknown number of records... and within those records an uknown number of fields... Here is an example of a single record: Mr G Aldred, 26/11/08, Canvardine Chance, Wolfies Dawn Tilley, KENINE SECRET DESTINY, d, c. Grey & White, KENINE SHADES OF THE NIGHT, d, c. Grey & White, KENINE SILENT WHISPER, b, c. Seal & White, KENINE SOFT KISSES, b, c. Grey & White, KENINE SPIRIT OF THE STORM, d, c. Seal & White KENINE STAR QUALITY, d, c. Seal & White And I could have multiple records like this, but with different number of names toward the end So, if I manually put some delimiting character instead of coma's , can I get PHP to read the WHOLE document in, split the document into records and then split those records into subfields to populate a form which I can then automatically submit to my database? Not sure if that is clear.... Thanks This portion is kind of stumping me. Basically, I have a two tables in this DB: users and users_access_level (Separated for DB normalization) users: id / username / password / realname / access_level users_access_level: access_level / access_name What I'm trying to do, is echo the data onto an HTML table that displays users.username in one table data and then uses the users.access_level to find users_access_level.access_name and echo into the following table data, I would prefer not to use multiple queries if possible or nested queries. Example row for users: 1234 / tmac / password / tmac / 99 Example row for users_access_level: 99 / Admin Using the examples above, I would want the output to appear as such: Username: Access Name: Tmac Admin I am not 100% sure where to start with this, but I pick up quickly, I just need a nudge in the right direction. The code I attempted to create just shows my lack of knowledge of joining tables, but I'll post it if you want to see that I did at least make an effort to code this myself. Thanks for reading! Hello, I am trying to populate the value="" of my form with the data from the mysql database so users can see what is already completed, trial and error have failed me. what am i doing wrong? <?php session_start(); include 'english.php'; if (!isset($_SESSION['user'])) die("<br /><br />You need to login to view this page"); $user = $_SESSION['user']; echo "<h3>Edit your Profile Search</h3>"; //opend database $connect = mysql_connect("$dbhost","$dbuser","$dbpass"); mysql_select_db("$dbname"); //select database // Get all the data from the "housing" table $result = mysql_query("SELECT * FROM users WHERE user='$user'") or die(mysql_error()); // keeps getting the next row until there are no more to get while($row = mysql_fetch_array( $result )) // Print out the contents of each row into a table ?> <form action="/includes/insert_profile.php" method="post"> <table border="0" cellspacing="0" cellpadding="3"> </td></tr> <tr><td>First Name:</td><td><input type="text" name="first" value="$first"> <tr><td>Middle Name:</td><td><input type="text" name="middle" value="$middle"> <tr><td>Last Name:</td><td><input type="text" name="last" value="$last"> <tr><td>Email:</td><td><input type="text" name="email" value="$email"> </td></tr> <tr><td>Date of Birth:</td><td> <select id="day" name="day" class="short"> <option value="1" selected="selected">1</option> <option value="2">2</option> <option value="3">3</option> </select> <select id="month" name="month" class="medium"> <option value="January" selected="selected">January</option> <option value="February">February</option> </select> <select id="year" name="year" class="medium"> <option value="2010" selected="selected">2010</option> <option value="2009">2009</option> <option value="2008">2008</option> </td></tr> <tr><td> <input type="Submit" value="Save"/> </td></tr> </table> </form> Ok, so I'm not quite sure how to explain this, but here it goes: I have table A that contains stats for all players in the NHL, and then I have table B with just a few players. These few players in table B are also in table A, but table B has more information on them. I want to take the stats for these players out of table A and put into table B, and I want table B to update along with table A every time those numbers change. How would I do this? Hi guys, This is my first time posting here - im just getting into PHP - i got a question; I have two databases: profile(id, name, interests, dob, gender, join_date, email) interests(id, profile_id, interests) id being the primary key, and profile_id being the foreign key from profile. I want to script that returns profile information and all the matching interests (one user can have multiple interests). This is what i have so far, though it does not work, and i knew it wouldnt; function get_profile($id) { $connection = mysql_open(); $query = "SELECT * "; $query .= "FROM profiles, interests "; $query .= "WHERE profile.id=" . $id; $query .= " AND interests.profile_id=" . $id; $result = @ mysql_query($query, $connection); // Transform the result set to an array (for Smarty) $entries = array(); while ($row = mysql_fetch_array($result)) { $entries[] = $row; } mysql_close($connection) or show_error();; return $entries; } Can someone please advise on how this can be done? or do i need to have two query's one for each table ? Thank you in advance!! Hi all, I am lost again in this PHP world. I am trying to set up a grade book for my reporting system. I have got totally lost in the code and I am need of some help. Many Thanks F Code: [Select] <?php function doquery($query) { $db = "prs"; $link = mysql_connect("localhost","gandalf","A3tti2ca") or die("Could not connect to server! Error: ".mysql_error()); mysql_select_db($db,$link) or die("Could not select $db! Error: ".mysql_error()); $result = mysql_query($query,$link) or $result = "Query Error!<p>Query: $query<p>Error: ".mysql_error(); mysql_close($link); return($result); } function parseresults($result) { if ($line = mysql_fetch_array('$result', MYSQL_ASSOC)) { displayform($line); } else { print "A database problem has occurred. Contact the database administrator<p>"; } } function displayform($line) { <<<HTML <form action="gradebook2.php" method="post"> <H4>Thank You, <p> HTML; print $line['firstname']." ".$line['surname']." (#".$line['upn'].") in set ".$line['class_set']; print ' has been sucessfully added to the system.<p>'; echo"<form id=\"Gradebook\" name=\"gradebook\" method=\"post\" action=\"gradebook2.php\"> <table width=\"77%\" border=\"1\" align=\"center\" cellpadding=\"5\" cellspacing=\"0\" bordercolor=\"#de6057\"> <tr> <td width=\"45%\" class=\"footer\"> <label class=\"form_labels\">Coursework Mark</label> </td> <td width=\"55%\"> <input name=\"cw_mark\" type=\"text\" id=\"cw_mark\" value=".$line['english_cw_mark']." tabindex=\"1\" size=\"6\" maxlength=\"4\" /> <input type=\"hidden\" name=\"upn\" value=".$line['upn']."> </td> </tr> <tr> <td class=\"footer\">Coursework Comment </td> <td> <label> <textarea name=\"cw_comment\" id=\"cw_comment\" cols=\"35\" rows=\"7\" value=".$line['english_cw_commnents']."></textarea> </label> </td> </tr> <tr> <td class=\"footer\"><label class=\"form_labels\">Exam Mark</label></td> <td> <input name=\"exam_mark\" type=\"text\" id=\"exam_mark\" value=".$line['english_exam_mark']." tabindex=\"3\" size=\"6\" maxlength=\"4\"> </td> </tr> <tr> <td class=\"form_labels\">Exam Comment </td> <td> <label> <textarea name=\"exam_comment\" id=\"exam_comment\" cols=\"35\" rows=\"7\" value=".$line['english_exam_comments']."></textarea> </label> </td> </tr> <tr> <td class=\"form_labels\"><label>Commendation in Poetry</label></td> <td> <select name=\"com_poetry\" id=\"com_poetry\" value=".$line['com_poetry']."> <option value=\"No Commendation\" selected=\"selected\">No Commendation</option> <option value=\"Commendation Awarded\">Commendation Awarded</option> </select> </td> </tr> <tr> <td class=\"form_labels\"><label>Commendation in Creative Writing</label></td> <td> <select name=\"com_creative\" id=\"com_creative\" value=".$line['com_creative']."> <option selected=\"selected\">No Commendation</option> <option value=\"Commendation Awarded\">Commendation Awarded</option> </select> </td> </tr> <tr> <td class=\"form_labels\">Commendation in Literary Interpretation</td> <td> <select name=\"com_lit_int\" id=\"com_lit_int\" value=".$line['com_lit_int']."> <option value=\"No Commendation\" selected=\"selected\">No Commendation</option> <option value=\"Commendation Awarded\">Commendation Awarded</option> </select> </td> </tr> <tr> <td class=\"form_labels\"><label>Overall Comments</label></td> <td> <textarea name=\"overall_comments\" id=\"overall_comments\" cols=\"35\" rows=\"7\" value=".$line['english_overall_commnents'].'"></textarea> </td> </tr> <tr> <td> </td> <td> <input type=\"reset\" name=\"Reset\" id=\"Reset\" value=\"Reset Form\" tabindex=\"12\" /> <input type=\"submit\" name=\"submit\" id=\"submit\" value=\"Submit Form\" tabindex=\"11\" /> </td> </tr> </table> </form>"; } $student_upn = (integer) $_POST["stu_upn"]; $query = "select count(*) as numberRecords from english where upn = ".$student_upn.""; $result = doquery($query); $row = mysql_fetch_array($result); if ($row['numberRecords'] == 0) { $query = "select students.upn from students where students.upn = '".$student_upn."'"; $result = doquery($query); $row = mysql_fetch_array($result); $cw_mark = $row['english_cw_mark']; $cw_comment = $row['english_cw_comments']; $exam_mark = $row['english_exam_mark']; $exam_comment = $row['english_exam_comments']; $com_poetry = $row['com_poetry']; $com_creative = $row['com_creative']; $com_lit_int = $row['com_lit_int']; $overall_comment = $row['english_overall_comments']; $insert = "insert into english (upn, english_cw_mark, english_cw_comments, english_exam_mark, english_exam_comments, com_poetry, com_creative, com_lit_int, english_overall_ comments) values (".$student_upn.",'".$cw_mark."','".$cw_comment."', '".$exam_mark.",'".$exam_comment."','".$com_poetry."','".$com_creative."','".$com_lit_int."','".$overall_comment."',0); print $insert; doquery($insert); } $query = select students.upn as upn, firstname, surname, class_set, from customers left join english on students.upn = english.upn where students.upn = ".$student_upn."; $result = doquery($query); if (is_resource($result)) { parseresults($result); } else { print "$result"; } print "<a href=\"gradebook.php\"><h4>Grade Another Student</h4></a>"; ?> Hey,
I have am creating a web app to hold customer and job details.. I have the following table structures to hold the data:
CREATE TABLE Customers ( customerID int(5) NOT NULL auto_increment, customer varchar(25) default NULL, contact varchar(25) default NULL, phone varchar(25) default NULL, email varchar(25) default NULL, address varchar(25) default NULL, PRIMARY KEY (customerid) ) ENGINE = INNODB; CREATE TABLE Jobs ( jobID int(5) NOT NULL auto_increment, customerID int(5) NOT NULL default '0', invoiceNumber varchar(25) default NULL, purchasOrder varchar(25) default NULL, orderDate datetime NOT NULL default '0000-00-00', dateRequired datetime NOT NULL default '0000-00-00', jobStatus varchar(25) default NULL, PRIMARY KEY (jobID) ) ENGINE = INNODB; CREATE TABLE vinyl ( vinylID int(5) NOT NULL auto_increment, jobID int(5) NOT NULL default '0', colour varchar(25) default NULL, font varchar(25) default NULL, size varchar(25) default NULL, fileLocation varchar(25) default NULL, PRIMARY KEY (vinylID) ) ENGINE = INNODB; CREATE TABLE screenprint ( screenprintID int(5) NOT NULL auto_increment, jobID int(5) NOT NULL default '0', colour varchar(25) default NULL, font varchar(25) default NULL, size varchar(25) default NULL, fileLocation varchar(25) default NULL, PRIMARY KEY (screenprintID) ) ENGINE = INNODB; CREATE TABLE items ( itemID int(5) NOT NULL auto_increment, jobID int(5) NOT NULL default '0', supplier varchar(25) default NULL, code varchar(25) default NULL, colour varchar(25) default NULL, style varchar(25) default NULL, total varchar(25) default NULL, dateOrdered varchar(25) default NULL, PRIMARY KEY (itemID) ) ENGINE = INNODB; CREATE TABLE itemsqty ( itemqtyID int(5) NOT NULL auto_increment, itemID int(5) NOT NULL default '0', jobID int(5) NOT NULL default '0', size varchar(25) default NULL, quanity int(5) NOT NULL default '0', PRIMARY KEY (itemqtyID) ) ENGINE = INNODB; CREATE TABLE embroidery ( embroideryID int(5) NOT NULL auto_increment, jobID int(5) NOT NULL default '0', code varchar(25) default NULL, stitchCount varchar(25) default NULL, quanity int(5) NOT NULL default '0', PRIMARY KEY (embroideryID) ) ENGINE = INNODB;Are these tables set out correctly for the collection of data needed. Also.. am I best to use Foreign Keys? My understanding of using foreign keys is not in place for queries as such, more to keep the tables clean of miss matched records etc? Thanks <?php $con = mysql_connect("localhost","user","password"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("contact", $con); $sql="INSERT INTO contact_info (FirstName, LastName, Phone, Email, ContactMethod, City, State, zip, TimeFrame, Agent, AgentInfo) VALUES ('$_POST[firstname]','$_POST[lastname]','$_POST[phone]','$_POST[email]','$_POST[contactmethod]','$_POST[city]','$_POST[state]','$_POST[zip]','$_POST[timeframe]','$_POST[agent]','$_POST[agentinfo]')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "1 record added"; mysql_close($con) ?> That's my code everything seem's to be working fine script runs and says 1 record added however when I go to view the entry phpMyAdmin the entry show's up without the data? OK, I've scoured the forms on here, searched and tutorial read and even pulled out an old PHP book. Alas, I'm stumped. First off, my two tables that I'm trying to pull data from: rubric ------------------------------------- ---- code ---- | ---- title -------- ------------------------------------- ABCD | Category Name schedule ---------------------------------------------------- ------ name ------ | ------ short_title ------ ---------------------------------------------------- ABCD-123-4569 | Title Is Here Now, none of these share the same value, per say. rubric.code shares the first THREE letters from schedule.name, but that is all. What I'm trying to do is something similar to the old: A apple automobile B banana basket bench C car child crumb ... etc, etc, where the letter heading is actually the rubric.title value and then underneath it it lists all the matching short_title from schedule where the first four letters of schedule.name match the value of rubric.code - if that even makes sense. Unfortunately these are the tables I have to work with. If anyone out there has any ideas, I would be thrilled to hear them. Another thing that is driving me crazy is that this server I'm working on doesn't have error reporting turned on so I've been stuck with just a white screen to let me know something is amiss. I'm running PHP Version 5.3.3-7+squeeze8 if that helps. Thank you! Ok I have a fairly straight forward question. I am designing a baseball website and I am trying to add in a schedule, here is what I have: Data Bases 1) Teams DB - Each team has a unique team ID, location, logo, and owner 2) Schedule DB - Each game has a unique game ID, and the schedule is set up like this: AWAY = Team ID, HOME = Team ID.... So I assume I am using the JOIN command to pull the schedule from both databases, any idea how the SQL command would look? so I'm trying to change some specific columns in a row in a table of a MySQL database by calling the Doctrine_Query when an option is selected inside an admin panel of my website. Here are the details: Table name: chatUsers I need to find all rows with the person who has a username of: $chatUsers->username (The column inside chatUsers is called username) Once all those rows are found, change the value of all the row's column "type" to "user" Is this even possible? So far I have: [/list] Code: [Select] <?php function userChatReset(){ $query = Doctrine_Query::create()->update('db_chatUsers')->set('type', 'user')->where('username = '.$chatUsers->username); //execute query $rows = $query->execute(); echo $rows.' rows updated'; } ?> ...And I'm not sure where to go from there, or if that's even correct. Sorry in advance, I'm not very good with PHP yet. Hey guys, Not sure how to do this. The basic principle of what I want to do is: ounit1 number (members table) * ounit1 power (ounit table) ounit2 number (members table) * ounit2 power (ounit table) etc to unit12. The members table has the fields: username ounit1 ounit2 ounit3 ounit4 etc for the number of units. The Ounit table has the fields: Ounit (primary auto increase) opower and a few more that are not needed for this. So basically, it it possible to call data from two different tables and multiply it? So far I've got: Code: [Select] <?php $result = mysql_query("SELECT * FROM members WHERE Username='$_SESSION[Username]'") or die(mysql_error()); while($row = mysql_fetch_array( $result )) { echo '<b>Power</b><br />'; echo 'Offence: ' . $row[''] . ' <br />'; echo 'Defence: ' . $row[''] . ' <br />'; echo 'Power: ' . $row[''] . ' <br />'; } ?> I'm not sure how to call two tables at once. Any help would be great! I have two tables 'book' and 'category'. They look like the following in phpmyadmin;
book
id title author category isbn ---- ------- ---------- ---------- ------- 1 Treasure Chest Jim Jones 1 14252637 2 Pirates Boat Sue Smith 2 88447737 3 Adventure Land Harry Jo 3 01918273 4 Winter Week Sam Dill 3 00999337 5 The Twite Roald Dahl Fiction 87873366 category id cat_name ---- ------- 1 Horror 2 Kids 3 Fiction 4 Science Users have the option of adding books into the library via an online form, or via a Google Booka api method (user enters isbn, searches, is presented with book info and then clicks 'add to library', done.). This is handled via ajax. The online form works fine, and successfully adds the book info. However my problem is with the Google Books method, it successfully adds the data to the db however the category column is in text format (i.e 'Juvenile Science' or 'Scary Fiction') as opposed to the manual form which adds categories as 1, 2 or 3 (1 =Horror, 2 = Kids, 3 = Fiction). Is there any way I can add the Google Book category data to my table and convert it to an integer or similar? Not sure what I need to do. Suggestions appreciated! Should I add the Google entries to another table (i.e googleCategory)? My HTML only outputs the numbered category entries and ignored the text format entries. my php $sql = "SELECT b.id, b.title, b.author, b.isbn, b.publicationYear, c.cat_name FROM book AS b INNER JOIN category AS c ON b.category = c.id WHERE status != 'Archive' ORDER BY id DESC LIMIT $startrow, 15 "; $res = $conn->query($sql) or trigger_error($conn->error."[$sql]"); while($row = $res->fetch_array()) { echo '<tbody>'; echo '<tr>'; echo '<td>' . $row['id'] . '</td>'; echo '<td>' . $row['title'] . '</td>'; echo '<td>' . $row['author'] . '</td>'; echo '<td>' . $row['cat_name'] . '</td>'; echo '<td>' . $row['isbn'] . '</td>'; echo '<td>' . $row['publicationYear'] . '</td>'; echo '</tr>'; echo '</tbody>'; };Apologies if this is all a bit confusing I am very new to php and mysql. Thanks, J Hi, I have multiple table Table -1 order_no name 1 raj table -2 order_no name 1 raj table 3 order_no name 1 raj table 4 order_no name 1 raj table 5 order_no name 1 raj I want a query to check if the id (one) is present in all tables or not, i create this. select order_no from prepress, press, postpress, qc, binding, dispatch where order_no=prepress.order_no AND order_no=press.order_no AND order_no=postpress.order_no AND order_no=qc.order_no AND order_no=binding.order_no AND order_no=dispatch.order_no but the ambiguous error for order_no. how to achieve this can anyone suggest me? thanks I've got a table (tbl_items) that holds a number of items and the individual information for each. Within 'tbl_items' I also have a row labeled 'category_id' in which each item is given a number (ex: 2). I've got a separate table (tbl_items_categories) that only has 2 rows: 'category_id' and 'category_name'. I wasn't sure if a JOIN method would be best for this but what would be the best approach to list all items and within each item, also echo out the name of the category they belong to and not the category_id number? I have been playing around with this. Thought I had it nailed, and then found that It was fubar when I started to add more entries to the database. I basically want to display 2 tables from my database on the page. One is called "players" the other is called "editlog". The output with my current script came out as this: and here is the dreaded code: <html> <body> <u><h3>Performance Point Monitor (PPM): Knights of Shadow WoW Officers.</h3></u> <?php include('/home/a3269923/public_html/ppm/admin/config.php'); include('/home/a3269923/public_html/ppm/admin/dbopen.php'); $query="SELECT * FROM players"; $result=mysql_query($query); $num=mysql_numrows($result); ?> <table border="1" style="position:absolute;width:500;height:10;left:0;top:70"> <tr> <th><font face="Arial, Helvetica, sans-serif">PLAYER</font></th> <th><font face="Arial, Helvetica, sans-serif">POINTS</font></th> <th><font face="Arial, Helvetica, sans-serif">DATE</font></th> </tr> <?php $i=0; while ($i < $num) { $f2=mysql_result($result,$i,"PLAYER_NAME"); $f3=mysql_result($result,$i,"ND_POINTS"); $f4=mysql_result($result,$i,"DATE ADDED"); ?> <tr> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f2; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f3; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f4; ?></font></td> </tr> </table> <?php $i++; } ?> <?php include('/home/a3269923/public_html/ppm/admin/config.php'); include('/home/a3269923/public_html/ppm/admin/dbopen.php'); //USER LOG $query="SELECT * FROM editlog"; $result=mysql_query($query); $num=mysql_numrows($result); ?> <table border="1" style="position:absolute;width:600;height:10;left:510;top:70"> <tr> <th><font face="Arial, Helvetica, sans-serif">USER</font></th> <th><font face="Arial, Helvetica, sans-serif">TYPE</font></th> <th><font face="Arial, Helvetica, sans-serif">POINTS</font></th> <th><font face="Arial, Helvetica, sans-serif">NOTES</font></th> <th><font face="Arial, Helvetica, sans-serif">DATE</font></th> </tr> <?php $i=0; while ($i < $num) { $f1=mysql_result($result,$i,"USER"); $f2=mysql_result($result,$i,"TYPE"); $f3=mysql_result($result,$i,"POINTS"); $f4=mysql_result($result,$i,"NOTE"); $f5=mysql_result($result,$i,"TIMESTAMP"); ?> <tr> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f1; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f2; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f3; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f4; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f5; ?></font></td> </tr> </table> <?php $i++; } ?> What am I doing wrong? Halp! Hi, My name is stefan and I've been trying to develop a php/mysql based CRM for private use. I've stumbled upon a problem a few days ago and I just can't figure it out, so if you could help me, I'd really appreciate it. The problem is the following: I have 1 database which contains 5 tables. Each table has info in it but the primary key always is 'ID' 4 Tables are named; Zendingen | Klanten | Manden | Bestemmeling The last table, named 'Combination' has the unique ID of each of those 4 in it. The example will be given below. What I want to do now is create a page that shows all stored rows in 'Combination'-table, but gets the proper client_name or product_info out of the corresponding table. I have searched for it myself but I have no clue where to begin and how to define my searches so they all stranded. This is the piece of code. Code: (php) [Select] $Shipm1 = mysql_query("SELECT * FROM Shipments where Zending_ID = 9") or die(mysql_error()); while($row = mysql_fetch_assoc($Shipm1)) { echo "<br />"; echo $row["ID"]; echo "<br />"; echo $row["Zending_ID"]; echo "<br />"; echo $row["Klant_ID"]; echo "<br />"; echo $row["Mand_ID"]; echo "<br />"; echo $row["Bestemmeling_ID"]; echo "<br />"; }This code returns: Quote 3 ---- the ID of the 'combination' table and thus primary key 9 ---- Zending_ID 47 --- Klant_ID 17 --- Mand_ID 2 ---- Bestemmeling_ID 4 This is another row from the combinations table, 9 notice that it only returns the Zending_ID = 9. 49 21 4 Now this gives me the info I want, but it doesn't displays them how I need it to. I want it to search up each ID in the proper table and return me the product name, client name etc... Anyone who can help or point me in the right direction? Kind regards Stefan Guys, quick one. Im writing a script for a form to post info into a MySql table. Now rather than just having a single row for input I'd like to have lets say 10 rows, so I can add 10 records to the database. What I'm pondering is 2 things: 1: can i just repeat Code: [Select] <input type="text" name="opponent" size="27" /> over and over, or is it going to need its own name each time for example; Code: [Select] <input type="text" name="opponent2" size="27" /> <input type="text" name="opponent3" size="27" /> 2: when it comes to the processing script is it more economical to have the forms input field named the same over and over (if it IS possible) and if not whats the most econimcal way to code my Code: [Select] $opp= $_POST['opponent']; $query="INSERT INTO fixtures (match_date, season, opponent) VALUES ('$date', '$season', '$opp',)"; Your help and comments are appreciated as always guys Tom |