gaogier Posted May 25, 2010 Share Posted May 25, 2010 echo"<img src=\"images/none.gif\" height=\"11\" width=\"11\"> <a href=\"calculate.php?action=enter_name&skill=".$name."&members=".$mem."\">$calc_name</a><br>"; This is what I need to enter, <ul class="02" ><li > </li></ul> so each new line is different... any ideas? I think its really simple, just can't see it. Quote Link to comment https://forums.phpfreaks.com/topic/202792-syntax-error/ Share on other sites More sharing options...
Bladescope Posted May 25, 2010 Share Posted May 25, 2010 Gaogier, You can change the double quotation marks to single marks if you're not going to be inserting variables in between the quotes. e.g. echo"<img src=\"images/none.gif\" height=\"11\" width=\"11\"> <a href=\"calculate.php?action=enter_name&skill=".$name."&members=".$mem."\">$calc_name</a><br>"; can be simplified to echo '<img src="images/none.gif" height="11" width="11"> <a href="calculate.php?action=enter_name&skill='. $name. '&members=' .$mem. '">'. $calc_name. '</a><br>'; Just makes things a little easier on the eyes in my opinion . This is what I need to enter, <ul class="02" ><li > </li></ul> so each new line is different... any ideas? I think its really simple, just can't see it. I don't understand :/ Quote Link to comment https://forums.phpfreaks.com/topic/202792-syntax-error/#findComment-1062828 Share on other sites More sharing options...
gaogier Posted May 25, 2010 Author Share Posted May 25, 2010 Basically, if you look at my site, http://runehints.com - left hand menu's v right hand menu's. I want the calculators to be like the left hand ones as they are not stats. <ul class="01"> <li ><a href="/">Home </a></li> <li ><a href="/forums">Forums </a></li></ul> Here is the whole php code. <?php $calc_query = "SELECT id, name, members FROM calc ORDER BY name ASC"; $calc_result = mysql_query ($calc_query); while ($calc_row = mysql_fetch_assoc($calc_result)) { $calc_name = $calc_row['name']; $name = strtolower($calc_name); $m = $calc_row['members']; if ($m == "Y"){ $mem = "yes"; }else{ $mem = "no"; } echo '<img src="images/none.gif" height="11" width="11"> <a href="calculate.php?action=enter_name&skill='. $name. '&members=' .$mem. '">'. $calc_name. '</a><br>'; } ?> My thoughts. <ul class="01"><?php $calc_query = "SELECT id, name, members FROM calc ORDER BY name ASC"; $calc_result = mysql_query ($calc_query); while ($calc_row = mysql_fetch_assoc($calc_result)) { $calc_name = $calc_row['name']; $name = strtolower($calc_name); $m = $calc_row['members']; if ($m == "Y"){ $mem = "yes"; }else{ $mem = "no"; } echo '<li ><img src="images/none.gif" height="11" width="11"> <a href="calculate.php?action=enter_name&skill='. $name. '&members=' .$mem. '">'. $calc_name. '</a></li>'; } ?></ul> Quote Link to comment https://forums.phpfreaks.com/topic/202792-syntax-error/#findComment-1062831 Share on other sites More sharing options...
Bladescope Posted May 25, 2010 Share Posted May 25, 2010 That should work, I don't seem to find any problems with it Quote Link to comment https://forums.phpfreaks.com/topic/202792-syntax-error/#findComment-1062838 Share on other sites More sharing options...
gaogier Posted May 25, 2010 Author Share Posted May 25, 2010 Ok, I have readded that code to the site, take a look at what it is doing. http://runehints.com Quote Link to comment https://forums.phpfreaks.com/topic/202792-syntax-error/#findComment-1062846 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.