Jump to content
Larry Ullman's Book Forums

Search the Community

Showing results for tags 'php sql dynamic'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Single Editions
    • Modern Javascript: Develop and Design
    • The Yii Book
    • Effortless Flex 4 Development
    • Building a Web Site with Ajax: Visual QuickProject
    • Ruby: Visual QuickStart Guide
    • C++ Programming: Visual QuickStart Guide
    • C Programming: Visual QuickStart Guide
    • Adobe AIR: Visual QuickPro Guide
  • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (5th Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)
    • PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide (3rd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (2nd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (1st Edition)
  • PHP for the Web: Visual QuickStart Guide
    • PHP for the Web: Visual QuickStart Guide (5th Edition)
    • PHP for the Web: Visual QuickStart Guide (4th Edition)
    • PHP for the Web: Visual QuickStart Guide (3rd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (2nd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (1st Edition)
  • Effortless E-commerce with PHP and MySQL
    • Effortless E-Commerce with PHP and MySQL (2nd Edition)
    • Effortless E-Commerce with PHP and MySQL
  • PHP Advanced: Visual QuickPro Guide
    • PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide (3rd Edition)
    • PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
    • PHP Advanced: Visual QuickPro Guide
  • MySQL: Visual QuickStart Guide
    • MySQL: Visual QuickStart Guide (2nd Edition)
    • MySQL: Visual QuickStart Guide (1st Edition)
  • Other
    • Announcements
    • Newsletter, Blog, and Other Topics
    • Forum Issues
    • Social

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 1 result

  1. Hi. I have this up and running: http://prntscr.com/5parca The input field uses autocomplete to select a horse. I want to link the autoconnect field to the SQL select query as a filter. Ideally, the query will only run when the user has selected a horse from the list of horses. <?php require_once('../Connections/AlKh.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $maxRows_qHorses = 20; $pageNum_qHorses = 0; if (isset($_GET['pageNum_qHorses'])) { $pageNum_qHorses = $_GET['pageNum_qHorses']; } $startRow_qHorses = $pageNum_qHorses * $maxRows_qHorses; mysql_select_db($database_AlKhamsa, $AlKhamsa); $query_qHorses = "SELECT * FROM horses"; $query_limit_qHorses = sprintf("%s LIMIT %d, %d", $query_qHorses, $startRow_qHorses, $maxRows_qHorses); $qHorses = mysql_query($query_limit_qHorses, $AlKhamsa) or die(mysql_error()); $row_qHorses = mysql_fetch_assoc($qHorses); if (isset($_GET['totalRows_qHorses'])) { $totalRows_qHorses = $_GET['totalRows_qHorses']; } else { $all_qHorses = mysql_query($query_qHorses); $totalRows_qHorses = mysql_num_rows($all_qHorses); } $totalPages_qHorses = ceil($totalRows_qHorses/$maxRows_qHorses)-1; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>DEMO of "how to feed jQuery UI�s autocomplete with a database-generated dataset" | burnmind.com</title> <meta name="description" content="DEMO of 'how to feed jQuery UI�s autocomplete with a database-generated dataset' | burnmind.com" /> <meta name="keywords" content="demo, burnmind, how to, jquery, ui, autocomplete, database, dataset" /> <link type="text/css" href="css/jquery-ui-1.8.5.custom.css" rel="Stylesheet" /> <style type="text/css"> body { background-color: #000; color: #fff; }; </style> <script src="js/jquery-1.4.2.min.js" type="text/javascript"></script> <script src="js/jquery-ui-1.8.5.custom.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { $('#auto').autocomplete( { source: "search.php", minLength: 3 }); }); </script> </head> <body> <p>Type the name of a horse: <input type="text" id="auto" /></p> <p> </p> <table> <tr> <td>Horse</td> <td><p>Birth </p> <p>Year</p></td> <td>Color</td> <td>Gender</td> <td>Dam</td> <td>Sire</td> </tr> <?php do { ?> <tr> <td><?php echo $row_qHorses['HorseName']; ?></td> <td><?php echo $row_qHorses['YOB']; ?></td> <td><?php echo $row_qHorses['HorseColor']; ?></td> <td><?php echo $row_qHorses['HorseGender']; ?></td> <td><?php echo $row_qHorses['DamName']; ?></td> <td><?php echo $row_qHorses['SireName']; ?></td> </tr> <?php } while ($row_qHorses = mysql_fetch_assoc($qHorses)); ?> </table> </body> </html> <?php mysql_free_result($qHorses); ?>
×
×
  • Create New...