Login | Register | FAQ
Anonymous

Link Problem - Retrieve data from a database

+ Post a reply

2 posts Page 1 of 1


Link Problem - Retrieve data from a database

by sjwbe » Sun Jan 17, 2016 5:32 pm

Dear Sir
As I got many help from you thanx for all that.
Sir here is a problem with me on this topic. As you described I created two pages named list.php and person.php and just copied your code and just connected it with my database, everything was ok and my post list came each row as a new link but when I clicked on one of them I just got the error "Notice: Undefined index: id in person.php on line 12"

(my database name is sjweb and table name is dictionary)

my line 12 is "$strSQL = "SELECT * FROM dictionary WHERE id =" . $_GET['id'];" .
if i change the id like "id=1" the error hides but on clicking on each link it shows only the first post only cause of the id=1.

because I am new to php mysql so I am not being able to solve this problem, If you can solve this I'll be very thankful to you sir.

thank you
User avatar

sjwbe

  • Posts: 1
  • Joined: Sun Jan 17, 2016 5:15 pm

Re: Link Problem - Retrieve data from a database

by RikTheGuy » Fri Apr 08, 2016 3:09 am

Well, nothing can accurately be said about your problem unless you provide all the code. Anyway, the problem that has occured seems to be pretty common. Your script can't set the get variable 'id'. Make sure that when your user visits this page, his URL is of the form :
www.example.com/this.php?id=something
User avatar

RikTheGuy

  • Posts: 1
  • Joined: Thu Apr 07, 2016 3:34 am


+ Post a reply

Page 1 of 1