Jump to content

maverick3d

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

maverick3d's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. craygo: thanks champ, this has created the link perfectly and so much easier from what I was using !
  2. wow such a positive response, thanks guys! craygo: I have tested your script and it is erroring with Parse error: syntax error, unexpected $end in C:\root\tlw.db\index.php on line 24 Line 24 is ending PHP ?> not sure why it would error this?
  3. Wolphie: I added your code to the top of the <?php and has not provided any errors or codes just a blank page. If I view the source it shows: <a href="index.php?id="></a>
  4. gigas10: thanks for the tip champ GingerRobot: Ah, sorry... it renders a blank page, no errors, text, hyperlinks - just nothing
  5. I am wanting to create a dynamic hyperlink using all the ID's in my Database Table which when clicked on the link will load a dynamic page with all the details of the selected ID. Wondering if someone could point out the flaw in my script. I am still pretty novice, c&c welcome: <?PHP $host="localhost"; $username="user"; $password="pass"; $conn = mysql_connect($host,$username,$password) or die(mysql_error()); mysql_select_db("test_db", $conn) or die(mysql_error()); $q = "SELECT id, first_name, last_name FROM names"; $result = mysql_query ($q); $num_rows = mysql_num_rows ($result); IF ($num_rows > 0) { FOR ($j=0; $j > $num_rows; $j++) { $id = mysql_query($result, $j, "id"); $firstname = mysql_query($result, $j, "first_name"); $lastname = mysql_query($result, $j, "last_name"); echo "<a href='index.php?id=", $id, "'>", $firstname, "</a>"; } //close FOR loop } // close for IF loop ?>
×
×
  • 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.