473,473 Members | 1,562 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

unexpected t_variable

I'm having trouble with my code and it barfs on the last line I have
included the lines before it are below
$histid = $_GET["histid"];
$sql = "select * from main_hist where histid = '$histid'";
$result = mysql_query($sql);
$r = mysql_fetch_array($result)
$maint_done = $r["maint_done"];
does anyone see anything wrong with this or do I need to include more of
the code.

Aaron
Dec 24 '06 #1
3 1392
See the actual error code... It will say which line the problem lies.
In this instance... see the line:

$r = mysql_fetch_array($result)

You missed the terminating character (semi-colon).

Hendri

_Skare_Krow_ wrote:
I'm having trouble with my code and it barfs on the last line I have
included the lines before it are below
$histid = $_GET["histid"];
$sql = "select * from main_hist where histid = '$histid'";
$result = mysql_query($sql);
$r = mysql_fetch_array($result)
$maint_done = $r["maint_done"];
does anyone see anything wrong with this or do I need to include more of
the code.

Aaron
Dec 24 '06 #2

_Skare_Krow_ wrote:
I'm having trouble with my code and it barfs on the last line I have
included the lines before it are below
$histid = $_GET["histid"];
$sql = "select * from main_hist where histid = '$histid'";
$result = mysql_query($sql);
$r = mysql_fetch_array($result)
$maint_done = $r["maint_done"];
does anyone see anything wrong with this or do I need to include more of
the code.

Aaron
As in your case, this is often caused by a missing semi-colon.

$r = mysql_fetch_array($result)

Dec 24 '06 #3
That's a real big duh!
_Skare_Krow_ wrote:
I'm having trouble with my code and it barfs on the last line I have
included the lines before it are below
$histid = $_GET["histid"];
$sql = "select * from main_hist
where histid = '$histid'";
$result = mysql_query($sql);
$r = mysql_fetch_array($result)
$maint_done = $r["maint_done"];
does anyone see anything wrong with this or do I need to include more of
the code.

Aaron
Dec 24 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: mooneater | last post by:
Hallo, ich bin neu mit dem Umgang mit PHP, und ich habe folgendes (siehe unten) programmiert. Nun erhalte ich bei Aufruf meiner PHP-Datei folgende Fehlermeldung: Parse error: parse error,...
2
by: aamer | last post by:
can anyone please help me, im getting a dumb: Parse error: syntax error, unexpected T_VARIABLE in /home/jeddah/public_html/lomar/cart/remove.php on line 5 in the following file, <?php...
4
by: bovanshi | last post by:
got this annoying error I'm completly new to php... and i have no clue what is wrong here, from what i can tell there is nothing rong with this code... but that isn't what the borwser say :P ...
10
by: kilo | last post by:
Someone please see what the problem is.. I have getting an error: Parse error: syntax error, unexpected T_VARIABLE, expecting '{' in /customers/test-dig.dk/test-dig.dk/httpd.www/database.inc.php on...
1
by: mdouble | last post by:
I'm a complete novice with HTML and PHP. Recently I purchased an auto responder that requires me to edit a PHP file during the installation process as per directions provided in a read me file. ...
6
by: Philth | last post by:
No doubt this has been covered lots in detail. I think I've almost got is sorted but for this one error. "Parse error: syntax error, unexpected T_VARIABLE in...
3
by: SilvaZodiac | last post by:
Hi everyone, I'm still rather new to PHP code, and I have a syntax error. I've tried several different solutions, but it won't fix. It seems to suggest that I need a new bracket somewhere in the...
4
by: needhelp08 | last post by:
I am getting the error Parse error: syntax error, unexpected T_VARIABLE on line 4 but I can't seem to find what is wrong. Could someone please help. <?php $conn = @mysql_connect("localhost",...
8
by: illuzion | last post by:
ok I keep getting this error: Parse error: syntax error, unexpected T_VARIABLE in /home/illuzion/public_html/BAMF/contactus.php on line 38 and this error is possibly on other lines could...
7
by: ashraf02 | last post by:
i have check the code thoroughly to find the error i am still getting the following error: Parse error: syntax error, unexpected T_VARIABLE in C:\wamp\www\Catalogue.php on line 23 <!DOCTYPE html...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.