PHP - Moved: I Just Don T See How To Link Fileds Of One Table To Another Table
This topic has been moved to MySQL Help.
http://www.phpfreaks.com/forums/index.php?topic=317025.0 Similar TutorialsOk so standard query can be written as: SELECT * FROM my_table WHERE specific_field = 'some_term' Is there some query that I can search for 'some_term' in all the fields at once in my_table without defining them in the query? SELECT * FROM my_table WHERE any_field = 'some_term' I am new to php.i want to be able to link echoed out rows from a table to another row in another table so that when users clicked the first row i echoed out it will take them to that SPECIFIC row i linked it to in the second table..JUST LIKE FACEBOOK...Please do i make sense or is there another way to do it. Thanks in advance Simple question but I couldn't find any straight forward answers.
I have a customer details table with: customer ID, name, address, email.
I also have an delivery table with delivery ID, customer ID, order ID.
How can I link the customer ID column from the customer table to the delivery table so that when changes occur on the customer table they subsequently alter all other tables?
I know it might use foreign keys but I couldn't find any online resource that explained how to use them properly.
Cheers
Hi, DaniWeb I'm doing a website for a music school and i have a table with all the instruments: And i want to click in one image and it goes to other page where's the instrument program. I mean, each image has 1 page with its own program. I have this code: Code: [Select] <?php include "db_connect.php"; $sql_imagem = "SELECT cod_curso, imagem_curso, nome_curso FROM curso ORDER BY nome_curso ASC"; $i=0; echo "<table width = 90% height = 45% align = center>"; $executa=mysql_query($sql_imagem,$connect); while($dados=mysql_fetch_array($executa)) { $i+=1; if ($i == 1) { echo "<tr> <td align = center>"; } else { echo "<td align = center>"; } echo "<img src=\"".$dados['imagem_curso']."\"/></a> <br /> ".$dados['nome_curso']; if ($i == 4) { echo "</td> </tr>"; $i=0; } else { echo "</td>"; } } echo "</table>"; ?> And i was thinking about using Arrays, but i don't know how to work with it. Can someone help me, please? Thank you, PF2G I have the following code: Code: [Select] $result = mysql_query("SELECT * FROM ESSAY_QUESTIONS WHERE SUBJECT = 'ENGLISH'") or die(mysql_error()); while($essay_data=mysql_fetch_array($result)){ $question = $essay_data['QUESTION']; $id = $essay_data['ID']; echo "<a href=\"englishessays.php?id=$id>"; echo "$question </a>"; echo "<br><br>"; } It seems to be almost working but it just displays one link and the address is all the rest of the code including </a>"; echo "<br><br>"; and other questions. I presume there's an error with how I've written the echo statements so can anyone see it? Or can anyone suggest a better way to do this? On the next page, the php will read the ID from the address and display the information form that record. hello, im trying to add a hyperlink that launches in a new window to the following (in the last column) any ideas? Code: [Select] echo "<tr>"; echo "<td align='center'>" . $row["ID"] . "</td>"; echo "<td align='center'>" . $row["Name"] . "</td>"; echo "<td align='center'>" . $row["jobNO"] . "</td>"; echo "<td align='center'>" . $epn . "</td>"; echo "<td align='center'>" . $cname . "</td>"; echo "<td align='center'>" . $cadd . "</td>"; //want to add a hyperlink here echo "</tr>"; } echo "</table>"; } In this output table, I would like to be able to click on any number in the ama row, add .html to that value and then execute the link. Example: If the ama number in row 3 is 890543, add .html to the number = 890543.html, then click on it to link to that web page. <?php // Connect to database ========================================= include("connect_db.php"); $table1='passwords'; $table2='airplanes'; // send query =================================================== $result = mysql_query("SELECT * FROM $table2") or die(mysql_error()); if (!$result) { die("Query to show fields from table failed"); } echo "<table border='10' cellpadding='3' cellspacing='2'>"; echo "<p>View All Airplanes</p>"; echo "<tr> <th>ID</th> <th>AMA #</th> <th>Model Name</th> <th>Model MFG</th><th>Wingspan</th><th>Engine</th><th>Decibels</th></tr>"; // 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 ========================== echo "<tr><td>"; echo $row['id']; echo "</td><td>"; echo $row['ama']; // Append .html to this number echo "</td><td>"; echo $row['model_name']; echo "</td><td>"; echo $row['model_mfg']; echo "</td><td>"; echo $row['wingspan']; echo "</td><td>"; echo $row['engine']; echo "</td><td>"; echo $row['decibels']; echo "</td></tr>"; } echo "</table>"; ?> This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=348465.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=321459.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=345265.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=313836.0 This topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=330967.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=330834.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=354977.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=355480.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=319161.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=305991.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=350064.0 This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=346821.0 This topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=331683.0 |