0

I have a SQL query within a PHP code.

$code = "SELECT children, mother FROM family WHERE childrenID = ' " . $_GET['childrenID'] . "';";

I get an error message saying that $_GET['childrenID'] is an undefined index.

how do I define this index?

SynozeN Technologies
  • 1,337
  • 1
  • 14
  • 19

1 Answers1

-1

First check do you have any value in $_GET['childrenID']. If yes you may also try to write your query like

$chid_id = $_GET['childrenID'];
$code = "SELECT children, mother FROM family WHERE childrenID = $chid_id";

Hope this will help you.