-2

I am doing this for an IT project, and I am not that experienced in using my SQL I am trying to run a query and this is the error that I keep on getting.

Fatal error: Call to undefined function msql_fetch_assoc() in C:\xampp\htdocs\my_test\index2.php on line 8


if ($query_run = mysql_query($query)){

  while($query_row = msql_fetch_assoc($query_run)) {

Above is a snippet of my code I have looked for this error and I cant seem to identify it. Please help me.

ajtrichards
  • 29,723
  • 13
  • 94
  • 101

3 Answers3

0

Change from msql_fetch_assoc() to mysql_fetch_assoc()

Nil'z
  • 7,487
  • 1
  • 18
  • 28
0

You have error in word "msql_fetch_assoc" :)

Must be mYsql_fetch_assoc

KryDos
  • 447
  • 4
  • 14
0

There isn't a function called msql_fetch_assoc(). You need to use mysql_fetch_assoc()

Please, don't use mysql_* functions in new code. They are no longer maintained and the deprecation process has begun on it. See the red box? Learn about prepared statements instead, and use PDO or MySQLi - this article will help you decide which.

Community
  • 1
  • 1
ajtrichards
  • 29,723
  • 13
  • 94
  • 101