Jump to content

PHP Select Not Echoing Properly


MarkT

Recommended Posts

Hello,

I currently have the following code;

<tr><td>ID</td><td>First Name</td><td>Surname</td><td>Form</td><td>Reason</td></tr><?PHP mysql_connect("*******","*****","****","******");$sql = mysql_query("SELECT * from bans");?>

And basically, I've tried to echo it in a table. so that it uses the results from SQL.

in the form

$sql['id']

$sql['name']

$sql['surname']

$sql['form']

$sql['reason']

 

In a seperate td

So <td> $sql['id']</td>

for example, so that it shows all of the bans in a seperate row per ban.

 

Please can somebody help! and supply me with the correct code I should put in the PHP File.

 

 

Cheers.

Link to comment
Share on other sites

is that all the code? Are you fetching from the database table like the following:

 

$row = mysqli_fetch_array($sql);

Yeh thats above, didnt copy that bit, but then it says "Expects to be resource"

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...