0

So I have a HTML file, it uses PHP. I have data that is stored in the database, MySQL. I am trying to retrieve whatever is printed in a column in a table. I have tried a bunch of different things, but not having to much luck.

I have NEW to PHP.

Table is character_table, column is picture.

Here is what I have and its not exactly right. What exactly am I doing wrong and how to fix?

    <?php
 $result= mysql_query("SELECT * FROM character_table");
 while($row = mysql_fetch_array($result)){
      echo $row['picture'];
 }

?>

Thank you very much.

  • For one thing, there's a curly quote `FROM character_table”` <<< right there and that will put the brakes on your code, given if that is your actual quote there. If it is, then you've a parsing error. That should be a `"` regular quote like so. – Funk Forty Niner Dec 02 '17 at 04:35
  • Same thing for `[‘picture’]` – Funk Forty Niner Dec 02 '17 at 04:36
  • @javaguy Please throw those old nasty `mysql_` calls in the rubbish. It is time to upgrade to `mysqli_` or `pdo`. Thank you for correcting your typos, but your question will not be opened while so many vital details are still missing. Please take the tour and read up on how to ask a question. We need to know things like: what exactly is wrong? Is it an error? or is there just unexpected output? What does the database table look like (structure and data)? What is your expected output? Keep going. – mickmackusa Dec 02 '17 at 07:13

0 Answers0