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
40
Other forums
error reporting
hey everyone
I have a production server in which I want error reporting but only on some page
login box shows up again after logging in 2nd login works
Hello,
I am having trouble on my site Lockerz.rack111.com where when you login the login box
Problem with shopcart code
Hello, I am having a bit of trouble being able to add a product to my shopcart. My mysql database i
How to file_get_contents when login required?
Hello!
I am trying to read data from a page that you have to be logged into to view, I am try
defining website tags
Hi,
What would be the best way to define tags for my site, such as website title, url etc.
trouble printing an array....
I'm having some trouble printing out an array forwards. I'm figuring out the high and low of an arra
Windows 7
Windows 7 default user account control worries experts. Corporate IT departments should be pleased w
tag inside php... hi
Code: <?php echo "<td width="$columnWidth%" align=&Error in write byte array into document in SM58 Hi Gurus,
Getting the following error status in Transactional RFC (SM58) ..... *Error i Problems with returning true or false in eval()'d code Hi guys,
Would appreciate some help with a problem when running eval() on a function that sho
|