Jump to content

Help with query


hollowmanu

Recommended Posts

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]

Link to comment
https://forums.phpfreaks.com/topic/204819-help-with-query/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.