Jump to content

hi - a simple question


meshi

Recommended Posts

I used to work with php and oracle DB,

I am trying to work now with MySql, I wrote this:

 

<?php

$con = mysql_connect("localhost","work","work");

if (!$con)

  {

  die('Could not connect: ' . mysql_error());

  }

mysql_select_db("work", $con);

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

 

echo '<table border="2">

<tr><th>username</th><th>password</th><th>describe</th></tr>';

while($row = mysql_fetch_array($result))

  {

  echo '<tr>';

  foreach ($row as $user)

  echo '<td>'.$user.'</td>';

  echo '</tr>';

  }

  echo '</table>';

 

?>

 

each data enter to the table twice, why is that? what should I change?

 

thanks for the hekp

Link to comment
https://forums.phpfreaks.com/topic/122090-hi-a-simple-question/
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.