Jump to content


Photo

what is the correct syntax to use here?


  • Please log in to reply
2 replies to this topic

#1 Ansel_Tk1

Ansel_Tk1
  • Members
  • PipPipPip
  • Advanced Member
  • 43 posts

Posted 30 March 2006 - 04:09 AM

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.


#2 Guest_footballkid4_*

Guest_footballkid4_*
  • Guests

Posted 30 March 2006 - 05:23 AM

If you are looking for something complex:
<?php
if ( preg_match( "#" . $regex . "#is" , $var ) )
{
     echo $var;
}
?>
Otherwise take a look at substr(), strstr(), stristr(), etc.

#3 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,017 posts

Posted 31 March 2006 - 11:59 AM

Change your query so you only pull records with the values you require.
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users