Jump to content

Archived

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

Ansel_Tk1

what is the correct syntax to use here?

Recommended Posts

Hi all - wondering if some kind soul out there could point me in the right direction.

I have created a repeating table that looks like this:

<body>
<form name="form1" method="post" action="">
<?php do { ?>
<table width="716" border="1">
<tr>
<td width="275"><?php echo $row_UploadInfos['id']; ?></td>
<td width="210"><?php echo $row_UploadInfos['value']; ?></td>
<td width="209">&nbsp;</td>
</tr>
</table>
<?php } while ($row_files = mysql_fetch_assoc($files)); ?></form>
</body>
</html>
<?php
mysql_free_result($files);

mysql_free_result($UploadInfos);
?>


my question is how would i go about changing the php echo $row_UploadInfos['value']; ?> to display only those records that contain certain text values?

Thanks! I'd appreciate any points.

Share this post


Link to post
Share on other sites
Guest footballkid4
If you are looking for something complex:
[code]<?php
if ( preg_match( "#" . $regex . "#is" , $var ) )
{
     echo $var;
}
?>[/code]
Otherwise take a look at substr(), strstr(), stristr(), etc.

Share this post


Link to post
Share on other sites
Change your query so you only pull records with the values you require.

Share this post


Link to post
Share on other sites

×

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.