1/17/2024 0 Comments If loop isset php![]() ![]() You are doing two things, 1) producing navigation links, and 2) when a link has been clicked, you are displaying the content that corresponds to the id in the clicked link. You need to step back and come up with a stateable definition of what your code needs to do. a link containing the same id that was in $_GET. If this was working, you are querying for the row of data WHERE the id column matches the $_GET value and looping to produce a (one) link with ?id=$data in it, i.e. The sql query you are showing and the output you are (trying) to produce from that query make no sense. If you don’t understand something, you need to ask specific questions. You need to do the things that have already been given in replies. The following is a reply I wrote for you on a different help forum. As I am new to php/mysqli/pdo, I understand that some advice would be advanced, so I would like any code, basic. I would very much appreciate any help, include code examples. $query = "SELECT * FROM topmenu WHERE ID =". The code: setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION) Notice: Undefined variable: data in C:\xampp\htdocs\testsite\index.php on line 56 Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\testsite\index.php on line 43 Notice: Undefined variable: row in C:\xampp\htdocs\testsite\index.php on line 43 ![]() ![]() I am using some code I found online that I have tried to adapt but I get error messages. I have a web site (test) that has a menu where you click an item, then text is displayed - or it would if I could solve some issues. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |