no idea what to do...


Posted on 16th Feb 2014 07:03 pm by admin

I'm fed up. I had issues with code that I have working on a different site that didn't work on my current site. I found a way to fix that but now I'm running into the same error on another page that I can't think of a way around:

'Parse error: syntax error, unexpected T_VARIABLE, expecting ']' in /my/path/to/file on line 75'
Here's the original code: (ine 75 is the line with the link in it.)
Code: <?php
$adquery = "SELECT * FROM ad_space WHERE id=1";
$adresult = mysql_query($adquery);
$adrow = mysql_fetch_assoc($adresult);
for($i=1;$i<6;$i++){
if($row['link'.$i] == '') {
$row['link'.$i] = '#';
}
echo "<a href="$row[link$i]" target="_blank"><img src="$row[image$i]" alt="$i" /></a>";
}
?>
I changed it to this hoping it would work but it didnt, values are blank.
Code: <?php
$adquery = "SELECT * FROM ad_space WHERE id=1";
$adresult = mysql_query($adquery);
$adrow = mysql_fetch_assoc($adresult);
for($i=1;$i<6;$i++){
$var = "link".$i;
$var2 = "image".$i;
if($row['link'.$i] == '') {
$row['link'.$i] = '#';
}
echo "<a href="$row[$var]" target="_blank"><img src="$row[$var2]" alt="$i" /></a>";
}
?>
As always, any help is appreciated.

Thanks,

No comments posted yet

Your Answer:

Login to answer
329 Like 40 Dislike
Previous forums Next forums
Other forums

How to write on database when a link is clicked?
Hi, I have a list of products in a gridview. When the link is clicked currently it takes to an ext

System copy error in RUN ABAP REPORT PHASE
Hi,
I am performing system copy on my test server. I have previously taken export of JAVA + A

Linux socket programming
Where can I find a good introduction to socket programming?

Weird problem with SELECT command..Help!
Hi!

It seems I'm having a really weird problem with SQL SELECT command....I have table into a

Remore client postprocessing phase getting dump SAPSQL_ARRAY_INSERT_DUPREC
Hello Expects,I have started remore client copy. Data was copied successfully. but while running pos

Code Help.. If txt input box empty search X instead..
I am having a problem with my search script. At current it will simply search by a selected date whi

quick question about System Change Number(SCN) in FlashBack Query topic
i know tht we can get the SCN of the database using flashback concept as follows

SQL>

Changing color in GD via variable?
Hey guys, I'm new here. x)

I'm very much a noob when it comes to PHP, but I'm trying to learn

Displaying returned XML in another PHP page
I have an online payment form that will return XML given if a payment is successful or declines. I

ASP.NET 2.0 - Enter Key - Default Submit Button
Hi,One of the most annoying things in developing web pages is handling the "Enter key" for form subm

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash