MySQL Forums
Forum List  »  Spanish

Re: Problema al conectar con sql en tablas
Posted by: Peter Brawley
Date: February 19, 2021 03:00PM

1 Nunca cree cuentas MySQL sin contraseñas


2 Los datos no numéricos deben citarse, así que ...

query = $sq1. " WHERE CLI.documento = $datoBuscar";

... debiera ser ...

query = $sq1. " WHERE CLI.documento = '$datoBuscar'";


3 Siempre pruebe las consultas directamente primero, por ejemplo, en el programa cliente mysql ... haga que su script haga eco de $ sql, cópielo y péguelo en el programa cliente mysql, corrija errores


4 Las llamadas a MySQL siempre deben incluir verificaciones de errores, por ejemplo ...

$cn = new mysqli('localhost', 'root', '', 'stecnico') or exit( mysqli_connect_error() );

$rs = $cn->query($query) or exit( $cn->error );

Options: ReplyQuote


Subject
Views
Written By
Posted
484
February 19, 2021 02:13PM
Re: Problema al conectar con sql en tablas
184
February 19, 2021 03:00PM
183
February 19, 2021 03:17PM
165
February 19, 2021 03:25PM
163
February 19, 2021 05:32PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.