hi everyone i am trying to get my website to show just data from my MySQL database that contain a sirtain string....
i.e.
if put in my url
page.php?abrv=php
php being the data in my abrv field of the database, so i only want to show fields in my database that have got php in the abrv field someone in a support chat room told me to put
if(!stristr($info, $abrv)))
continue;
but it just gave me,
Parse error: parse error in /home/user01/public_html/members/showscripts.php on line 20
now the error has gone i changed
if(!stristr($info, $abrv))) continue;
to
if(!stristr($info, $abrv)))
continue;
and now i dont have any errors at all but i just dont get ANYTHING whatsoever.
here is the code i have got it currently just searches the database and shows the information in the database with ALL of the categorys from the abrv field.
this can be seen @ http://project.icthost.com (in the members section theres a demo account already setup.)
<?php
//INCLUDE THE CONFIGURATION SCRIPT
$abrv = $_GET["abrv"];
include "config.php";
include("adminconfig.php");
$db = mysql_connect($db_host,$db_user,$db_pass);
mysql_select_db ($db_name) or die ("Cannot connect to database");
$query = "SELECT * FROM php_scripts";
$result = mysql_query($query);
while($r=mysql_fetch_array($result))
{
$id=$r["id"];
$title=$r["title"];
$info=$r["info"];
$abrv=$r["abrv"];
$homepg=$r["homepg"];
$filename=$r["filename"];
$date=$r["date"];
$author=$r["author"];
echo "<table border='1' width='100%' cellspacing='0' cellpadding='0'>
<tr>
<td width='20%' valign='top'><font size='1' face='Verdana'> »Script
Category:<b> $abrv<br>
</b>»Author: <b>$author<br>
</b>»Date Added: <b>$date</b></font></td>
<td width='80%'>
<table border='0' width='100%' cellspacing='0' cellpadding='0'>
<tr>
<td width='100%'>
<table border='0' width='101%' background='/images/titlefill.jpg' cellspacing='0' cellpadding='0'>
<tr>
<td width='3%'><img border='0' src='/images/titleleft.jpg' width='19' height='31'></td>
<td width='82%'>
<p align='center'><font size='2' face='Verdana' color='#FFFFFF'><b> $title</b></font></td>
<td width='17%'> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td width='100%'><font size='2'><b>Description:<br>
</b>$info</font></td>
</tr>
</table>
<table border='0' width='100%' cellspacing='0' cellpadding='0'>
<tr>
<td width='50%'><b><font face='Verdana' size='2'>Homepage: <a href='$homepg'>$homepg</a></font></b></td>
<td width='50%'><font face='Verdana' size='2'><b>Download File: </b><a href='http://www.scriptu.com/scripts/$filename'>$filename</a></font></td>
</tr>
</table>
</td>
</tr>
</table><br>";
}
mysql_close($db);
?>
Anyone who can help it will be MOST appreciated.
WHOEVER HELPS ME OUT GETTING THIS HUGE PROBLEM SORTED I WILL GIVE A FREE HOSTING/RESELLER ACCOUNT AT WWW.ICTHOST.COM,
Thank You,
Gavin Hanson
ICThost Communications LTD
http://www.icthost.com