Jump to content

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

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.)

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.