Jump to content

php query


paparts

Recommended Posts

A simple example.

 

<?php

  // connect to db

  $sql = "SELECT url,sitename FROM links";

  if ($result = mysql_query($sql)) {
    if (mysql_num_rows($result)) {
      while ($row = mysql_fetch_assoc($result)) {
        echo "<a href='{$row['url']}'>{$row['sitename']}</a><br />";
      }
    }
  }

?>

Link to comment
https://forums.phpfreaks.com/topic/110738-php-query/#findComment-568114
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.