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

PHP If Else statement for breadcrumb
Hi

I am trying to use a PHP if else statement to display a breadcrumb link on wordpress

Vertical Alligning - Not working in 1 cell?
<?php

echo "<table id="valign" width="60%" style=

PHP & Java
Hello,

can PHP code be used inside java code?

Code: <SCRIPT LANGUAGE="Java

On page view, minus credit
Hello all, please, I need a little help with this script. I am charging one credit (credits can be p

Help with page encoding issue and weird characters
I'm trying to write a screen scraper and when I pull out the lines of the html file that I'm interes

Mail from PHP form not always ending up in my inbox?
Hi guys,

I'm a real newbie to PHP and have managed to put together a simple mail form that se

Socket Server Response Headers
Earlier I had a post about my Socket Server, I wasn't able to get it to connect, now I can

I

Help With editting and deleting form
Hallo !!

So look at this image :

http://img194.imageshack.us/img194/8272/snapshot5f.pn

remove a ; from emails in textarea
Code: <?php

session_start();

$database_host = "localhost&qu

Wrong Info sent Using $get in form
Hi i have this code that i tried to make to send some info from one page to aother with lots of ppls

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