0

I'm not a php programmer. I manage this site: http://cambiocorsasrl.com/. Some days ago I moved it to another hosting provider and from there I get this error:

"Notice: Use of undefined constant mysql_fetch_assoc - assumed 'mysql_fetch_assoc' in /var/www/vhosts/axential000031/httpdocs/lib/myclass.php on line 49".

I tried with host but they told me that all is ok thier side. This is the line 49 of myclass.php :

function select ($sql="", $fetch=mysql_fetch_assoc)

I tried to change line 49 to:

function select ($sql="", $fetch=mysql_fetch_assoc($results))

but I get this error:

"Parse error: syntax error, unexpected '(', expecting ')' in /var/www/vhosts/axential000031/httpdocs/lib/myclass.php on line 49"

What do I wrong? Thanks a lot in advance. Roberto

Alexander O'Mara
  • 58,688
  • 18
  • 163
  • 171
  • 3
    1. That code makes no sense. 2. `mysql_*` functions are obsolete, perhaps your new host does not support them. – Alexander O'Mara Nov 20 '15 at 08:59
  • You're getting the errors because neither of your two examples are valid PHP syntax. In fact, they demonstrate quite a big misunderstanding of how things work. This isn't the place for me to give you a full-on tutorial into the basics of programming, but suffice to say it looks to me as if you need to find a better tutorial than the one you're currently working with. (also note that the `mysql` functions are obsolete, so if you're using a tutorial that is recommending using those, then the tutorial is also obsolete) – Simba Nov 20 '15 at 10:29

0 Answers0