Jump to content

[SOLVED] help show values from db


maxbox

Recommended Posts

Hello  , i need show in a html page all telephone nummber from tables can you help me

db suecia

tables  user:

tel

code

 

And my code to conn to db

 

<?php
$mysql_host="xxxxxxxxxxx";
$mysql_user="xxxxxx";
$mysql_password="xxxxx";
$mysql_db = "suecia"; 
$mysql_tables = "user";

$conn = mysql_connect("$mysql_host","$mysql_user","$mysql_password","$mysql_tables");
if (!$conn) {
    die('Could not connect: ' . mysql_error());
}

mysql_select_db($mysql_db,$conn);


$result = @mysql_query(SELECT * FROM user);

 

 

......................

 

Link to comment
https://forums.phpfreaks.com/topic/137378-solved-help-show-values-from-db/
Share on other sites

<?php
$mysql_host="xxxxxxxxxxx";
$mysql_user="xxxxxx";
$mysql_password="xxxxx";
$mysql_db = "suecia"; 
$mysql_tables = "user";

$conn = mysql_connect("$mysql_host","$mysql_user","$mysql_password","$mysql_tables");
if (!$conn) {
    die('Could not connect: ' . mysql_error());
}

mysql_select_db($mysql_db,$conn);


$result = mysql_query("SELECT * FROM user");

while ($row = mysql_fetch_assoc($result)) {
      echo "User Tel: " . $row['tel'] . "   User Code: " . $row['code'] . "<br />";
}

?>

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.