| | |
make link from a variable.
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: May 2009
Posts: 81
Reputation:
Solved Threads: 0
Hi all.. really need a help. this is looks easy peasy but I can't solve it 
I want to make a link from lesson ID to a details of the selected lesson ID.
when I run the coding the following error appear on that line.
Parse error: parse error, expecting `','' or `';'' in C:\xampp\htdocs\lina\resultlink.php on line 65.
How the details page should be constructed so that the lessonID can be passed to it.?
many thanks for your help.
-tulip

I want to make a link from lesson ID to a details of the selected lesson ID.
<td> "<a href='details.php?lessonID=". $lessonID ."'> </a>" </td> when I run the coding the following error appear on that line.
Parse error: parse error, expecting `','' or `';'' in C:\xampp\htdocs\lina\resultlink.php on line 65.
How the details page should be constructed so that the lessonID can be passed to it.?
many thanks for your help.
-tulip
Last edited by peter_budo; Jun 9th, 2009 at 10:25 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
•
•
Join Date: Jun 2009
Posts: 64
Reputation:
Solved Threads: 4
try this
php Syntax (Toggle Plain Text)
echo "<td bgcolor=#9B5DCA><a href='link_page.php?id={$lessonID'>".stripslashes(delete)."</a> </td>";
•
•
Join Date: Jun 2009
Posts: 68
Reputation:
Solved Threads: 10
<?php $lessonID =2; ?> <td><a href='details.php?lessonID=<?php echo $lessonID; ?>'> </a></td>
Last edited by djjjozsi; Jun 9th, 2009 at 9:14 am.
•
•
•
•
<?php $lessonID =2; ?> <td><a href='details.php?lessonID=<?php echo $lessonID; ?>'> </a></td>
PHP Syntax (Toggle Plain Text)
<?php $lesson = 2; echo "<td><a href='details.php?lessonID={$lessonID}'</a></td>"; ?>
If you need to stripslash/escape the value, do it beforehand:
PHP Syntax (Toggle Plain Text)
$lesson = stripslashes($other_var); ...
Happy Humbugging Christmas
GCS d- s+ a-->? C++(++++) UL+++ P+>+++ L+++ E--- W+++
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
•
•
Join Date: May 2009
Posts: 81
Reputation:
Solved Threads: 0
ShawnCplus,
many thanks for your kind help.
this is the full code..
I have the details page ( details.php) to be linked from the selected ID).
thanks,
many thanks for your kind help.
this is the full code..
I have the details page ( details.php) to be linked from the selected ID).
thanks,
php Syntax (Toggle Plain Text)
<?php mysql_connect("localhost","root",""); mysql_select_db("student") or die("Unable to select database"); ?> <form name="form" action="result.php" method="get"> Subject <input type="text" name="q" /> Topic <input type="text" name="r" /> Ability <input type="text" name="s" /> <input type="submit" name="Submit" value="Search" /> </form> <?php // Get the search variable from URL $q = $_GET['q'] ; $r = $_GET['r'] ; $s = $_GET['s'] ; // Build SQL Query $myquery = "select * from lesson where subject like '%".$q."%' AND learningArea like '%".$r."%' AND ability like '%".$s."%'"; //echo $myquery ; $result = mysql_query ($myquery); echo "<table>" ; echo "<tr><th>Lesson ID</th>"; echo "<th>Subject</th>"; echo "<th>Learning Area</th>"; echo "<th>No of Students</th>"; echo "<th>Time Period</th>"; echo "<th>Class</th>"; echo "<th>Ability</th></tr>"; while ($row= mysql_fetch_array($result)) { $lessonID = $row["lessonID"]; $subject = $row["subject"]; $learningArea= $row["learningArea"]; $noofstudent= $row["noofstudents"]; $minutes= $row["minutes"]; $class= $row["class"]; $ability= $row["ability"]; //display the row echo "<tr> <td><a href='details.php?lessonID=<?php echo $lessonID; ?>'> </a></td> <td>$subject</td> <td>$learningArea</td> <td>$noofstudents</td> <td>$minutes</td> <td>$class</td> <td> $ability</td> </tr>" ; } echo "</table>"; ?>
Last edited by Ezzaral; Jun 10th, 2009 at 3:10 pm. Reason: Added [code] [/code] tags. Please use them to format any code that you post.
•
•
Join Date: Oct 2007
Posts: 78
Reputation:
Solved Threads: 5
I think the problem is here
it should be:
Try this and let me know it is working or not?
PHP Syntax (Toggle Plain Text)
$myquery = "select * from lesson where subject like '%".$q."%' AND learningArea like '%".$r."%' AND ability like '%".$s."%'";
it should be:
PHP Syntax (Toggle Plain Text)
$myquery = "select * from lesson where subject like '%'.$q.'%' AND learningArea like '%'.$r.'%' AND ability like '%'.$s.'%'";
Try this and let me know it is working or not?
![]() |
Similar Threads
- Want to make a Link Management system (PHP)
- default variable as a pointer in class (C++)
- Maximum possible nodes in any link list (C++)
- need to make a link (PHP)
Other Threads in the PHP Forum
- Previous Thread: Internationalization - MySQL queries
- Next Thread: cake php
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary body broken cakephp checkbox class cms code cron curl database date date/time directory display download dynamic echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla limit link list login loop mail menu mlm mod_rewrite msqli_multi_query multiple mycodeisbad mysql oop parse paypal pdf php problem query radio random recourse recursion regex remote script search seo server sessions sms soap source space sql static structure syntax system table tutorial update upload url validation validator variable video web webdesign wordpress xml youtube






