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

[function.file]: failed to open stream: No such file or directory
Okay I wrote this little script to upload a csv file that is located on my webhosts server to a mysq

Displaying image pathname instead of image
Hello

Im trying to upload and then display images from a mysql database - Its only basic and

Securing a user input - need some confirmation
Hello All,

I am in the process of recoding a large proportion of an e-commerce site, one of t

what business processes?
Hi,

A general question. What business processes (like OTC - Order to Cach, P2P, R2R etc)

How to replace search button with link?
hi to everbody.
i have a search submit form and button like this :

<form id="f

Preserving user-entered linebreaks
Hi, I'm building a web 2.0 thingy from scratch and I wanna display text which users input. It's all

php code generators
All

Whilst enjoying learning a new language i have come accross a number of free code generat

Concatenate two strings ???
I have string one $string1 and another $string2.

How to concatenate (add) both of them $str

Getting Subdomain Name With PHP?
I want to grab the subdomain name with PHP so I can generate database queries.

for example my

How to know if online site made with PHP
Hello,
I see some sites that does not display extensions at all , for example:

www.site.co

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