MarkT Posted July 18, 2013 Share Posted July 18, 2013 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 More sharing options...
Don E Posted July 18, 2013 Share Posted July 18, 2013 is that all the code? Are you fetching from the database table like the following: $row = mysqli_fetch_array($sql); Link to comment Share on other sites More sharing options...
MarkT Posted July 19, 2013 Author Share Posted July 19, 2013 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 More sharing options...
Ingolme Posted July 19, 2013 Share Posted July 19, 2013 That means that the query failed. We have a thread explaining it in detail here: http://w3schools.invisionzone.com/index.php?showtopic=44106 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now