Jump to content

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/202792-syntax-error/
Share on other sites

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 :/

Link to comment
https://forums.phpfreaks.com/topic/202792-syntax-error/#findComment-1062828
Share on other sites

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>

Link to comment
https://forums.phpfreaks.com/topic/202792-syntax-error/#findComment-1062831
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.