Link to home
Start Free TrialLog in
Avatar of Kyle Hamilton
Kyle HamiltonFlag for United States of America

asked on

language feature not compatible... error

Hi,

I have this line which works in php 5.3, but not below. Is there a way to rewrite it for php 5.2?

 
sql("SELECT * FROM idx_cities WHERE city_name REGEXP '^$city_name' LIMIT 0, 10;", function($data){
    echo "<li><span id='{$data['idxID']}'>{$data['city_name']}</span></li>";
  },"");

Open in new window


total PHP/MySQL newbie here... I have (almost) no idea what I'm doing..

Thanks,
Koza
ASKER CERTIFIED SOLUTION
Avatar of maeltar
maeltar
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
oops line 8 should read

while ($data = mysql_fetch_assoc($result))

Open in new window

Sorry, am tired !

Line 1 , remove the semi-colon...
Avatar of Kyle Hamilton

ASKER

That worked a treat. Thank you.

As a matter of interest, what's the incompatibility, the placement of the function?
Not sure to be honest, I just know what works :)
cheers, thanks.