Forum Moderators: coopster

Message Too Old, No Replies

Parse Error

         

smartcard

3:37 pm on Oct 28, 2005 (gmt 0)

10+ Year Member



One of my script all these days working fine, and all of a sudden started giving the following error message. I did not do any changes, but it happened:

Error Message
Parse error: parse error, unexpected T_STRING, expecting T_VARIABLE or '$' in /home/zoolo/public_html/ke/3.php on line 424

This is what is line 424:
$query = "SELECT thumb FROM $dbimg WHERE itemno='$data[itemno]' ORDER BY id DESC LIMIT 1";

jatar_k

3:45 pm on Oct 28, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



try
$query = "SELECT thumb FROM $dbimg WHERE itemno='" . $data[itemno] . "' ORDER BY id DESC LIMIT 1";

though I am not sure if that will fix it or not

smartcard

6:00 pm on Oct 28, 2005 (gmt 0)

10+ Year Member



My server:
PHP version 4.3.11
MySQL version 4.0.25-standard

The script is working in my home PC, but not in this server.

Any clue?

jatar_k

6:17 pm on Oct 28, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



well the original syntax you posted in your first post shouldn't actually work as arrays don't resolve within double quotes. They have to be as I posted or they need to be surrounded by braces

smartcard

7:03 pm on Oct 28, 2005 (gmt 0)

10+ Year Member



It works with one server and not working with another server.

jatar_k

5:30 am on Oct 29, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I'm sorry but it shouldn't work on any server

it is a syntax error, did you try what I suggested?

dmmh

6:04 am on Oct 29, 2005 (gmt 0)

10+ Year Member



maybe something's wrong on the previous line.....line 423