Jump to content

Select*from ....WHERE ...


bemax

Recommended Posts

Hi,

Can someone help me to find what is wrong in this. It doesn't give me things from my Database.

 

<div id="centercontent">

<table border="0" width="100%" >

    <tr>

            <td>

          Montrer resultat

                        <?

                       

                                if(isset($_POST['find']))

                                {

                                        $srch = $_POST["find"];// This is what I receive from an other page - I get it (no problem)

//echo "$srch";

                                }

                                // Make a MySQL Connection

include( "sumba/conn.php");

// Get all the data from the "News_Nk" table

$result = mysql_query("SELECT id,theme,titre,text,src FROM News_Nk WHERE titre='%$srch%'") or die(mysql_error());

$info = mysql_fetch_array( $result);

while($info = mysql_fetch_array($result ))

{

 

Print "<b>Titre:</b> ".$info['titre'] . " ";

Print "<b>Text:</b> ".$info['text'] . " <br>";

}

                               

 

                          ?>

                </td>

        </tr>

  </table>

</div>

 

Thanks in advance

 

Bemax

 

Link to comment
https://forums.phpfreaks.com/topic/174108-selectfrom-where/
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.