sql - Pass value in php -
hi have modules links in student page after click on 1 of these links want pass id of specific module next page,so how can pass id value , code, please help.
$sql = "select * module,user user_access_level = module_level , '$user_id' = user_login "; $result = $db->query($sql); if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { echo '<li><a href="personal.php?id=".$g['module_id']."\">'.$row["module_id"].' '.$row["module_name"].' '.$row["module_points"].'</a></li> '; } }
here code of quotes, concatenations, backticks , backward logic corrected:
$sql = "select * `module`, `user` `user_access_level` = 'module_level' , `user_login` = '". $user_id."' "; $result = $db->query($sql); if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { echo '<li><a href="personal.php?id="'.$g['module_id'].'"\">'.$row["module_id"].' '.$row['module_name'].' '.$row['module_points'].'</a></li> '; } }
i bet module_level
supposed variable. $g
looks problematic, sets array $g
? should replace $g
$row
if reading correctly.
Comments
Post a Comment