joint table

  • ultimate11
  • Student
  • Student
  • ultimate11
  • Posts: 86

Post 3+ Months Ago

guys whats the flow of joining a table in which when you post the browser will identify you..

for example in here when i post a new topic it indicate that i'm the owner of that post..
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Bogey
  • Bogey
  • Genius
  • Bogey
  • Posts: 8363
  • Loc: USA

Post 3+ Months Ago

Are you at all familiar with PHP and MySQL?
  • ultimate11
  • Student
  • Student
  • ultimate11
  • Posts: 86

Post 3+ Months Ago

not so in php but in mysql yes...My first dynamic page before is ASP..I JUST dont get will the flow of joining tables maybe a diagram...
  • Bogey
  • Bogey
  • Genius
  • Bogey
  • Posts: 8363
  • Loc: USA

Post 3+ Months Ago

WIKI SQL JOIN syntax
SQL Code: [ Select ]
SELECT * FROM TABLE JOIN table2 ON TABLE.field1 = table2.field1 WHERE TABLE.field2 = 'value'

I think that's what you might be referring to. If not, please elaborate.
  • ultimate11
  • Student
  • Student
  • ultimate11
  • Posts: 86

Post 3+ Months Ago

how to display the value of one filed in a textbox..
  • Bogey
  • Bogey
  • Genius
  • Bogey
  • Posts: 8363
  • Loc: USA

Post 3+ Months Ago

PHP Code: [ Select ]
<?php
// Connecting to the SQL Server
$link = mysql_connect($host, $user, $pass);
 
// Selecting the database
mysql_select_db($dbname, $link);
 
// The SQL to retrieve joint information from the database
$sql = "SELECT * FROM TABLE JOIN table2 ON TABLE.field1 = table2.field1 WHERE TABLE.field2 = 'value'"
 
// Setting a result resource of the SQL that we can work with
$result = query($sql);
 
// Looping through each retrieved piece of information
while($info = mysql_fetch_assoc($result))
{
    // Printing the information
    echo "<input type='text' value='{$info}' />";
}
?>
  1. <?php
  2. // Connecting to the SQL Server
  3. $link = mysql_connect($host, $user, $pass);
  4.  
  5. // Selecting the database
  6. mysql_select_db($dbname, $link);
  7.  
  8. // The SQL to retrieve joint information from the database
  9. $sql = "SELECT * FROM TABLE JOIN table2 ON TABLE.field1 = table2.field1 WHERE TABLE.field2 = 'value'"
  10.  
  11. // Setting a result resource of the SQL that we can work with
  12. $result = query($sql);
  13.  
  14. // Looping through each retrieved piece of information
  15. while($info = mysql_fetch_assoc($result))
  16. {
  17.     // Printing the information
  18.     echo "<input type='text' value='{$info}' />";
  19. }
  20. ?>

That should work, but I haven't tested it so there might be a bug in there somewhere but I don't see any there... the comments above the lines of code explain what the code is doing.
  • ultimate11
  • Student
  • Student
  • ultimate11
  • Posts: 86

Post 3+ Months Ago

tnks..

Post Information

  • Total Posts in this topic: 7 posts
  • Users browsing this forum: No registered users and 81 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.