Help! I can not understand what the error is (

<?php if(isset($_POST['login'])){$login=$_POST['login']; if ($login=='') {unset($login);}} if (isset($_POST['password'])){$password=$_POST['password']; if ($password==''){unset($password);}} if (empty($login) or empty($password)) { exit("12"); } $login=stripslashes($login); $login=htmlspecialchars($login); $password=stripcslashes($password); $password=htmlspecialchars($password); $login=trim($login); $password=trim($password); include("bd.php"); $result=mysql_query("SELECT id FROM user WHERE login='$login'",$db); $myrow=mysql_fetch_array($result);///<----здесь ошибка пишет. if(empty($myrrow['id'])) { exit("21!"); } $result2=mysql_query("INSET INTO user (login,password) VALUES ('$login','$password')"); if($result2=='TRUE') { echo "asт</a>"; } else { echo "da!"; } ?> 

when registering a user, gives an error. bd not and, probably.

Reported as a duplicate by participants Alexey Shimansky , Dmitriy Simushev , Ipatiev , Alex , Duck Learns to Take Cover 24 Nov '16 at 19:42 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

  • one
    This site has a search . They are allowed to use - Alexey Shimansky
  • sho again? you did not read the answer to the previous question? - Alexey Shimansky
  • so everything is fine , everything is robbing - HardKoT
  • so what's the problem? the error is the same .... the answer says how to fix it. Or did you read and forget? Then reread - Alexey Shimansky
  • I added a problem - HardKoT

1 answer 1

Why don't you just simply output the result of the mysql_error() function and not flood? After all, the reason for the error was written there, and I don’t see any reason to guess. An error occurred while executing a query using the mysql_query() function. This error could occur if: no access to the database, a database that was not correctly selected, no specified table, etc.
Also remove the semicolon here:

 while ($univer = mysql_fetch_array($univer_info);) 

========== Addition:

You have an error in the request. Write instead

 univer_info=mysql_query("SELECT * FORM vuz"); 

Here it is univer_info = mysql_query ("SELECT * FROM vuz");

  • it is in the file connection to the database - HardKoT
  • @HardKoT, insert the mysql_error () function before the error and write the answer here - Node_pro
  • through another file the change goes. - HardKoT
  • db to be in phpmyadmin - HardKoT
  • Yes, you insert what you are asked. PhpMyAdmin is a tool, not a base - Node_pro