1 Replies - 316 Views - Last Post: 18 February 2013 - 05:46 AM Rate Topic: -----

#1 dunnage88  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 22
  • Joined: 14-November 12

Print my SQL query in php

Posted 18 February 2013 - 05:32 AM

I realise this is probably a very simple problem but for some reason I can't seem to write the php to print the results of this query.

$artistCommentsFeed= mysql_query("SELECT comment, date_Of_Entry FROM ArtistComments");


I am very new to php and help would be great thanks!
Is This A Good Question/Topic? 0
  • +

Replies To: Print my SQL query in php

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3576
  • View blog
  • Posts: 10,439
  • Joined: 08-June 10

Re: Print my SQL query in php

Posted 18 February 2013 - 05:46 AM

indeed, that’s a problem explained in almost all tutorials I know on that topic. there is even an example in the Manual for mysql_query().

nevertheless, the mysql extension is deprecated, you should use the way more modern PDO or MySQLi extensions instead (and they even prevent SQL Injection through Prepared Statements).

This post has been edited by Dormilich: 18 February 2013 - 05:47 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1