mysql - my php code can't get the value in the url -


I have created a webpage. In this webpage I read the data and put them in a dropdown list as you can see here:

  & lt; The width of the table = "200" range = "1" & gt; & Lt ;? Includes php (".. / inc / mysql.php"); $ Q2 = "SELECT * FROM tbl_group;"; $ R2 = mysql_query ($ Q2); $ N2 = mysql_num_rows ($ r2); {$ M2 = mysql_fetch_array ($ r2) for ($ I = 0; $ i & lt; $ n2; $ i ++); ? & Gt; & Lt; TR & gt; & Lt; Td> & Lt; A href = "insertpage.php? Id = & lt ;? php echo $ m2 ['id']? & Gt;" & Gt; نمایش & lt; / A & gt; & Lt; / Td> & Lt; / TR & gt; Php}? & Gt; & Lt; / Table & gt;  

I line up every line I read, and in another query. Therefore, after clicking on each row, my id is sent to the URL, because I want to select a ID value for a subset of another query. Below you can see that I am using the ID value to select the query:

  & lt; Table width = "200" border = "1" & gt; & Lt ;? Includes php (".. / inc / mysql.php"); If (isset ($ _GET ['id'])) {$ q23 = "SELECT * FROM tbl_cat where IDGRAUP =". $ _ GET ['id'] ";"; $ R23 = mysql_query ($ Q23); $ N23 = mysql_num_rows ($ R23); {$ M23 = mysql_fetch_array ($ r23) for ($ I = 0; $ i & lt; $ n23; $ i ++); ? & Gt; & Lt; TR & gt; & Lt; Td> & Lt; A href = "insertpage.php? Cated = & lt ;? php $ m23 ['id'] ;? & gt;" & Gt; انتخاب & lt; / A & gt; & Lt; / Td> & Lt; Td> & Lt ;? Php echo $ m23 ['cat']? & Gt; & Lt; / Td> & Lt; / TR & gt; & Lt ;? Php}}? & Gt; & Lt; / Table & gt; Therefore  

In this query I send the url catid to my table, but the address of my code cated variable Can not apply

I want to assume this to be included in my table.

All of these codes are placed in phpfile

   

So my problem is in another query, can not read my code cated which I sent before the first query?

Thank you

You made a mistake

  $ q2 = "SELECT * to tbl_group;"; -  

replace it with

  $ q2 = "SELECT * FROM tbl_group";  

Comments