Jump to content

mattkirtley

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Everything posted by mattkirtley

  1. Ah right, I have been pulling my hair all day trying different quiries! Thanks for that - any ideas where i can find a decent script?
  2. Hi, I have an insert script into a database with serveral fields one of them is a drop down box fed from a mysql database, what i need to do is in the next field populate it with a field from the same database driven by the choice from the drop down box ?> <option value="<?php echo $row_artists['artist_show']?>" ><?php echo $row_artists['artist_show']?></option> <?php } while ($row_artists = mysql_fetch_assoc($artists)); ?> </select> Any ideas? Many thanks!
  3. Hi, Im a newbie to PHP and SQL and wondered if someone would helpful enough to point me in the right direction? I have a page which is currently returning data from a table fine, i've intoduced a search field which is working great on its own i've pasted the code below.... However i want to intoduce a second field which could be searched in, i would like them to work independantly of each other, i have pasted the code i doctored at the bottom, the issue is that i cannot search in the 'city' field on its own without having to fill in the 'venue_name' field ??? $colname_venue = "%"; if (isset($_POST['venue_name'])) { $colname_venue = $_POST['venue_name']; } mysql_select_db($database_brsenter_BRS, $brsenter_BRS); $query_venue = sprintf("SELECT id, venue_name, city, first_name, last_name, telephone, email1, web_url FROM VENUE WHERE venue_name LIKE %s", GetSQLValueString("%" . $colname_venue . "%", "text")); $query_limit_venue = sprintf("%s LIMIT %d, %d", $query_venue, $startRow_venue, $maxRows_venue); $venue = mysql_query($query_limit_venue, $brsenter_BRS) or die(mysql_error()); $row_venue = mysql_fetch_assoc($venue); -------------------------------------------------------------------------------- $colname_venue = "%"; if (isset($_POST['city'])) { $colname_venue = $_POST['city']; } $colname2_venue = "%"; if (isset($_POST['venue_name'])) { $colname2_venue = $_POST['venue_name']; } mysql_select_db($database_brsenter_BRS, $brsenter_BRS); $query_venue = sprintf("SELECT id, venue_name, city, first_name, last_name, telephone, email1, web_url FROM VENUE WHERE city LIKE %s OR venue_name LIKE %s", GetSQLValueString("%" . $colname_venue . "%", "text"),GetSQLValueString("%" . $colname2_venue . "%", "text")); $query_limit_venue = sprintf("%s LIMIT %d, %d", $query_venue, $startRow_venue, $maxRows_venue); $venue = mysql_query($query_limit_venue, $brsenter_BRS) or die(mysql_error()); $row_venue = mysql_fetch_assoc($venue); Thanks
×
×
  • Create New...

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.