Jump to content

PHP and MySQL


Alka-Seltxer

Recommended Posts

By your post it seems you literally are 100% new to PHP and MySQL. While I agree with learning by doing, I think first you need to read up on some basic theory.

 

With that said, here's some basic code to retrieve values....

 

<?php

// Assuming you're already connected to the DB
$res  = mysql_query("SELECT id, name, price FROM tblProduct ORDER BY name ASC");

while($row = mysql_fetch_assoc($res))
{
echo $row['name']."<br />";
echo $row['price']."<br /><br />";
}

?>

Link to comment
https://forums.phpfreaks.com/topic/112698-php-and-mysql/#findComment-578770
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.