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 /home/fhlinux162/g/greatestalbumsever.com/user/htdocs/php/image.php on line 11"
Usually something to do with a bracket missing or something, but I can't see what it is.
My code is as follows. $albumNumber is being passed from via a html link to this script. "content" is the row in my table storing the image data -
<?
-
if(isset($_GET['albumNumber']))
-
{
-
mysql_connect("__MUNGED__","__MUNGED__","__MUNGED__");
-
mysql_select_db("freelance");
-
-
$albumNumber = $_GET['albumNumber'];
-
$query = "SELECT content FROM Albums WHERE albumNumber = '$albumNumber'";
-
-
$result = mysql_query($query)
-
$content=$r["content"];
-
-
header("Content-Type: image/jpeg");
-
echo $content;
-
}
-
?>
-
-
Any suggestions would be most welcome. Thanks!
6 1585
Use code tags please. Makes things easier.
DONT PUT YOUR DETAILS UP EITHER! Anyone can get into your mysql now!
Change your password asap.
Heya, Philth.
Changed thread title to better describe the problem (did you know that threads whose titles do not follow the Posting Guidelines actually get FEWER responses?).
Please use CODE tags when posting source code:
[CODE=php]
PHP code goes here.
[/CODE]
You're missing a semicolon.
-
<?
-
if(isset($_GET['albumNumber']))
-
{
-
mysql_connect("__MUNGED__","__MUNGED__","__MUNGED__");
-
mysql_select_db("freelance");
-
-
$albumNumber = $_GET['albumNumber'];
-
$query = "SELECT content FROM Albums WHERE albumNumber = '$albumNumber'";
-
-
$result = mysql_query($query) // <<<< missing ';' as pbmods said.
-
$content=$r["content"];
-
-
header("Content-Type: image/jpeg");
-
echo $content;
-
}
-
?>
-
-
Cheers guys!
Obvously wasn't paying too much attention when posting this - thanks for the help.
Heya, Philth.
Glad to hear you got it working! Good luck with your project, and if you ever need anything, post back anytime :)
Well, couldn't check last night, but it seems to have dealt with the error issue, now it doesn't actually do anything - no error, no action - don't know which is worse.
I'm using the following as my html image script...
<img src='php/image.php?albumNumber=$albumNumber'/>
Which is successfully picking up the album number variable.
The image date is definately in the database, it just doesn't want to pick it up.
Sign in to post your reply or Sign up for a free account.
Similar topics
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,...
|
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...
|
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
...
|
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...
|
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",...
|
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...
|
by: redsky |
last post by:
Hi,
I'm getting this error in my code (trying to make a submit button work) and can't figure out what the problem is. Can someone help me?
Parse error: parse error, unexpected T_VARIABLE in...
|
by: fburn |
last post by:
I need some help with an error I'm getting using php 5.2.5 running on linux.
I receive an error:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or...
|
by: URmusicandvideo |
last post by:
I have just finshed my first php code and posted it online and I am getting a Parse error: syntax error, unexpected T_VARIABLE in /home/hydeands/public_html/phpmail.php on line 45
But when I look...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
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,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
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...
|
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...
| |