473,388 Members | 1,496 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

dynamic link

hi all.i have faced a problem.


input used:

i have a mysql database named form.there is a table named dynamic.

three attributes here

id ( primary key,auto increment)
name.
company.


Expected result:

i want to show the data of the name field and make them a link to go to another page as like as:

mushfiq
mishuk

the two above name will used to go to the page "dynamic2.php" .As for example ,if i click on mushfiq,the url will be "dynamic2.php" & in that show the company where mushfiq works.but

mushfiq
mishuk

is not showed by ..

error codes:

Parse error: syntax error, unexpected $end in c:\wamp\www\dynamic.php on line 33


Expand|Select|Wrap|Line Numbers
  1.  <!DOCTYPE html PUBLIC
  2.      "-//W3C//DTD XHTML 1.0 Strict//EN"
  3.      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  4.  <html>
  5.  <head>
  6.  <title>
  7.  </title>
  8.  </head>
  9.  <body>
  10.   <?php
  11.        mysql_connect("localhost", "root", "");
  12.    mysql_select_db("form");
  13.       $result=mysql_query("select name from dynamic") or  die(mysql_error()); 
  14.  
  15.       if(mysql_num_rows($result)==0)
  16.        {
  17.         echo "database is empty <br>";
  18.        }  else 
  19.         {
  20.          while(list($id,$name)=mysql_fetch_array($result))
  21.           {
  22.         ?>
  23.  <a href="dynamic2.php?id=<?php $id ?>"> <?php echo $name; ?>  </a> <br >
  24.  
  25.         <?php
  26.         } 
  27.  
  28. ?>
  29.  </body>
  30.  </html>
  31.  
may be problem is in that line:

<a href="dynamic2.php?id=<?php $id ?>"> <?php echo $name; ?> </a> <br >


but i m not sure.if anyone can help me, i will be greatful.
Nov 10 '08 #1
4 1186
Markus
6,050 Expert 4TB
Mushfiq, this is an official warning: use code tags when posting code in the forums. Failure to adhere to the Forum Guidelines will result in a ban.
Nov 10 '08 #2
Markus
6,050 Expert 4TB
The error you receive is because you are missing a closing brace for your else statement.
Nov 10 '08 #3
i cant understand.did i not use code tag?
Nov 10 '08 #4
NeoPa
32,556 Expert Mod 16PB
I'm afraid not. They were added later by Markus, a moderator of this forum.

PS. Notice that he has also submitted an answer to your question. This is much easier to see if the code is posted clearly as suggested.
Nov 11 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Manu | last post by:
Hello, i ve again a little problem with my dynamic web site... i need to insert a dynamic link (css) into my body ! Why ? because i've a html template and i insert into the body a dynamic...
4
by: Daniel Keller | last post by:
Hello! I'm trying to set up a page system using "dynamic" SSI. That means that I normally use the following on my website: <!--#include virtual="file.inc" --> Now I want to make this...
3
by: WebBuilder451 | last post by:
I have a series of dynamic link buttons created based upon a datareader. I've added a click event and it calls the sub ok: example: "while loop through the reader" Dim ltrCtrl As New...
0
by: UtilityWarrior | last post by:
If you use Visual Basic 6 or VB.net and want to create PDFs from images royalty free then this DLL is for you. The Image to PDF Dynamic Link Library (DLL) will convert one or more images (JPEG,...
2
by: JWL | last post by:
Hi I need to create a bunch of sites with slightly dynamic CSS. Basically, all the image paths in the CSS need to be dynamic, depending on the values of certain ASP variables. I can think of...
5
by: pittendrigh | last post by:
There must be millions of dynamically generated html pages out there now, built by on-the-fly php code (and jsp, perl cgi, asp, etc). Programatic page generation is transparently useful. But...
12
by: Lazoris | last post by:
OK heres a newb question and I'm sorry for it, but im getting back into web design after like 5 years off and im stuck even though i should know the problem i cant seem to correct it atm. What I'm...
2
by: David W | last post by:
I need to include a style sheet link in the aspx page based on what user they are. Basically this functionality, but using code behind. Any idea how to change this line to code behind? This...
12
by: prashant | last post by:
hi, i am trying to create an xml tag ref to hold link.php?id=1; or link.php?id=2 and so on. I want the links for all the fields(id) in the databse so that when i call them in my html page for...
2
Frinavale
by: Frinavale | last post by:
I've created a ASP.NET control that displays a "book" of schedules. It dynamically displays scheduling times and allows the user to page through the schedules. It also lets the user edit the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.