[SOLVED] Repeat Region DWMX Problem

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

and here's what should work for you:

Code: Select all

<?php require_once('../../Connections/hungryusaconnection.php'); ?>
<?php
$colname_rsmenu = "1";
if (isset($HTTP_GET_VARS['namefield'])) {
  $colname_rsmenu = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['namefield'] : addslashes($HTTP_GET_VARS['namefield']);
}
mysql_select_db($database_hungryusaconnection, $hungryusaconnection);
$query_rsmenu = sprintf("SELECT * FROM menus WHERE item LIKE '%%%s%%' ORDER BY item ASC", $colname_rsmenu);
$rsmenu = mysql_query($query_rsmenu, $hungryusaconnection) or die(mysql_error());
$row_rsmenu = mysql_fetch_assoc($rsmenu);
$totalRows_rsmenu = mysql_num_rows($rsmenu);
//mysql_free_result($rsmenu);
?>
<?php 
do 
{
//$row_rsmenu ++; 
print( '<p style="color: #000000">' ); 
print( $row_rsmenu ['item' ]. '<p>' ); 
}
while ( $row_rsmenu =mysql_fetch_assoc ($rsmenu )); 
?>
note which lines are commented
saltriver
Forum Commoner
Posts: 59
Joined: Fri Mar 12, 2004 2:40 pm
Location: Burlington, VT

Post by saltriver »

That produced this error

Code: Select all

Parse error:  parse error in /home/virtual/site110/fst/var/www/html/testing/middle/name_results.php on line 5
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

it should be copy-paste error, make sure you copied source code properly. There's no syntax errors in the code I posted.
saltriver
Forum Commoner
Posts: 59
Joined: Fri Mar 12, 2004 2:40 pm
Location: Burlington, VT

Post by saltriver »

Boo-Ya!
There were two "E"s infront of one of the tabbed lines.

Thanks
Post Reply