hollowmanu Posted June 15, 2010 Share Posted June 15, 2010 I recently wrote this code for a database project in my college, its really basic since I'm nowhere near a pro in php <?php include("conectamysql.php"); $conexion=conectarse("root","","plani"); if(isset($nombre)) {$sql="select * from plani where nombre like '$nombre%' order by nombre"; } else {$sql="select * from plani order by identidad" ; } $r = mysqli_query($conexion,$sql) or die("Error: ".mysqli_error($conexion)); while($row=mysqli_fetch_array($rs)) { $identidad=$row["identidad"]; $nombre=$row["nombre"]; $direccion=$row["direccion"]; $sueldo=$row["sueldo"]; $telefono=$row["telefono"]; $celular=$row["celular"]; ?> <tr> <td><? echo $identidad; ?></td> <td><a href="consultaventas.php?codemple=<? echo $identidad ; ?>"><? echo $nombre; ?></a></td> <td><? echo $direccion ; ?></td> <td><? echo $sueldo ; ?></td> </tr> <? } mysqli_free_result($rs); ?> but when I try it I get this msg Error: Table 'plani.plani' doesn't exist Even though I now the table and database exist, since the table has one record. I'm sorry if the mistake is too noobish or the likes of that, but I just started like a month ago ty in advance I attach the php file that I wrote to see if anyone can help me [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/204819-help-with-query/ Share on other sites More sharing options...
PFMaBiSmAd Posted June 15, 2010 Share Posted June 15, 2010 You would need to post the actual table definition in order to give someone enough information to help you. You either have a spelling error or a letter-case difference (assuming you are on an operating system that is case sensitive.) Quote Link to comment https://forums.phpfreaks.com/topic/204819-help-with-query/#findComment-1072261 Share on other sites More sharing options...
Mr_J Posted June 15, 2010 Share Posted June 15, 2010 can't see much wrong, what is in the "conectamysql.php"? I recon it is the user, pw etc?? Quote Link to comment https://forums.phpfreaks.com/topic/204819-help-with-query/#findComment-1072262 Share on other sites More sharing options...
hollowmanu Posted June 15, 2010 Author Share Posted June 15, 2010 yes, it is the php file that has the connection parameters, I'll attach it to this reply [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/204819-help-with-query/#findComment-1072266 Share on other sites More sharing options...
hollowmanu Posted June 15, 2010 Author Share Posted June 15, 2010 by table definition you mean? The database? Or the fields in the table? The script to add info to the database works fine, here take a look [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/204819-help-with-query/#findComment-1072267 Share on other sites More sharing options...
PFMaBiSmAd Posted June 15, 2010 Share Posted June 15, 2010 Yes, well, the table name is empleados not plani Quote Link to comment https://forums.phpfreaks.com/topic/204819-help-with-query/#findComment-1072268 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.