Ok i can't figure this out any more I thought I had it but then i used my refresh button everytime i enter a script.php?id=1 or 2 (2 has the # sign in it) it still gives me the else statement. Id like to add a split statement after the the stristr statement but i cant even get up to that part yet. And using strchr instead of stristr doesn't make a difference.
But when i use
list ($oldpart, $newpart) = split ('[#]', $row["name"]);
it seems to split it up fine every time and do what i want but when i enter id=1 (which doesn't have a pound sign) i then get the first statement instead of the else statement... Any help would be great. Sorry i'm new but ive been trying thing after thing to get this goin, hope this makes sense.
<html>
<body>
<?php
$part = "USE PART";
$db = mysql_connect ("localhost", "root", "root");
mysql_select_db("test",$db);
if ($id == "")
{$id = '%';}
if ($name == "")
{$name = '%';}
$result = mysql_query ("SELECT * FROM ticket_fields
WHERE id LIKE '$id%'
AND name LIKE '$name%'
",$db);
$cnt = 0;
while($row= mysql_fetch_array($result)){
$cnt++;
if (stristr ("#", $row["name"])){
print "Check out our new part here, the part number is";
}
else {
print "i dont know what to do any more";
}
}
if (!$cnt) echo 'No records found';
?>
</body>
</html>