Jump to content

Glyph

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Glyph's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Also, how do I generate the output. I've tried your suggestion but it only prints the first item in the list. I presume it uses implode, but what would the precise syntax be?
  2. Thanks, but what's a lookup hash?
  3. I am trying to tweak the sample code presented on [a href=\"http://www.tizag.com/mysqlTutorial/mysqlwhere.php\" target=\"_blank\"]this page[/a]. [b]<?php // Make a MySQL Connection mysql_connect("localhost", "admin", "1admin") or die(mysql_error()); mysql_select_db("test") or die(mysql_error()); // Get a specific result from the "example" table $result = mysql_query("SELECT * FROM example WHERE name='Sandy Smith'") or die(mysql_error()); // get the first (and hopefully only) entry from the result $row = mysql_fetch_array( $result ); // Print out the contents of each row into a table echo $row['name']." - ".$row['age']; ?>[/b] In particular, I want to specify a list of records to obtain from the database, rather than just one. The contents of the list needs to be explicitly specified, as does the order, since it is based on something that simply can't be programmed to order them automatically. Using the above example, instead of just displaying the record for Sandy Smith, I would like to display the records for Bobby Wallace, Tim Mellowman, and Sandy Smith, in that order. How would I rewrite the above in order to produce this?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.