PHP Search

Hi all,
I am building some pages in PHP where I want to use dependant dropdowns to create a search.
I have created the dependant dropdowns in a form (method = POST), with the data sourced from my database through a standard recordset, and added a 'Submit' button,  and I now want to query the database using all 4 of these fields to bring back the result(s) in a table below.
Can someone please point me in the right direction
Thanks
PS...the dependant dropdown pat is working fab so no need to touch that (I dont think!)

I dont seem to making any headway here at all, so have stripped back the page and started again (this is only a development test page at the mo, hence no formatting or anything else!) . I have included only the dependant dropdowns in a form with a submit button, and not gone as far as putting in the results table beneath it.
If you feel willing to continue helping that would be appreciated....thank-you
<?php require_once('Connections/test.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;
mysql_select_db($database_test, $test);
$query_installed = "SELECT * FROM installed_sites";
$installed = mysql_query($query_installed, $test) or die(mysql_error());
$row_installed = mysql_fetch_assoc($installed);
$totalRows_installed = mysql_num_rows($installed);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="wrapper">
  <div class="header">
    <table width="772" border="0">
      <tr>
        <td width="80">Home</td>
        <td width="120">Documentation</td>
        <td width="120">Installed Sites</td>
        <td width="120">EE CoC</td>
        <td width="120">Admin</td>
        <td width="186">Logout</td>
      </tr>
    </table>
  </div>
  <div class="page">
    <p></p>
    <p> </p>
    <form id="form1" name="form1" method="post" action="">
      <select id="Motorway" name="Motorway" onchange="Motorway_reload(this)">
        <option selected="selected">Motorway</option>
      </select>
      <select id="Geographic" name="Geographic" onchange="Motorway_reload(this)">
        <option selected="selected">Geographic</option>
      </select>
      <select id="Carriageway" name="Carriageway" onchange="Motorway_reload(this)">
        <option selected="selected">Carriageway</option>
      </select>
      <select id="Lane" name="Lane" onchange="Motorway_reload(this)">
        <option selected="selected">Lane</option>
      </select>
      <script language="JavaScript" type="text/javascript">
//<![CDATA[
Motorway_contents=new Array();
Motorway_tempArray=new Array();
Motorway_counter=0;
Motorway_isDataOrdered=0;
function Motorway_addContent(str){
    Motorway_contents[Motorway_counter]=str;
    Motorway_counter++;
function Motorway_split(){
    Motorway_arrayValues = new Array();
    for(i=0;i<Motorway_contents.length;i++){
        Motorway_arrayValues[i]=Motorway_contents[i].split(separator);
        Motorway_tempArray[0]=Motorway_arrayValues;
function Motorway_makeSelValueGroup(){
    Motorway_selValueGroup=new Array();
    var args=Motorway_makeSelValueGroup.arguments;
    for(i=0;i<args.length;i++){
        Motorway_selValueGroup[i]=args[i];
        Motorway_tempArray[i]=new Array();
function Motorway_makeComboGroup(){
    Motorway_comboGroup=new Array();
    var args=Motorway_makeComboGroup.arguments;
    for(i=0;i<args.length;i++) Motorway_comboGroup[i]=findObj(args[i]);
function Motorway_setDefault(){
    for (i=Motorway_selValueGroup.length-1;i>=0;i--){
        if(Motorway_selValueGroup[i]!=""){
            for(j=0;j<Motorway_contents.length;j++){
                if(Motorway_arrayValues[j][(i*2)+1]==Motorway_selValueGroup[i]){
                    for(k=i;k>=0;k--){
                        if(Motorway_selValueGroup[k]=="") Motorway_selValueGroup[k]=Motorway_arrayValues[j][(k*2)+1];
function Motorway_loadMenu(daIndex){
var selectionMade=false;
daArray=Motorway_tempArray[daIndex];
Motorway_comboGroup[daIndex].options.length=1;
var Motorway_cur_daArrayValue="";
if(Motorway_isDataOrdered==1){
    for(i=0;i<daArray.length;i++){
        if(Motorway_cur_daArrayValue!=daArray[i][(daIndex*2)+1]){
            Motorway_comboGroup[daIndex].options[Motorway_comboGroup[daIndex].options.length]=new Option(daArray[i][daIndex*2],daArray[i][(daIndex*2)+1]);
            Motorway_cur_daArrayValue=daArray[i][(daIndex*2)+1];
}else{
    for(i=0;i<daArray.length;i++){
        existe=false;
        for(j=0;j<Motorway_comboGroup[daIndex].options.length;j++){
            if(daArray[i][(daIndex*2)+1]==Motorway_comboGroup[daIndex].options[j].value) existe=true;
        if(existe==false){
            lastValue=Motorway_comboGroup[daIndex].options.length;
            Motorway_comboGroup[daIndex].options[Motorway_comboGroup[daIndex].options.length]=new Option(daArray[i][daIndex*2],daArray[i][(daIndex*2)+1]);
            if(Motorway_selValueGroup[daIndex]==Motorway_comboGroup[daIndex].options[lastValue].value ){
                Motorway_comboGroup[daIndex].options[lastValue].selected=true;
                selectionMade=true;
if(selectionMade==false) Motorway_comboGroup[daIndex].options[0].selected=true;
function Motorway_reload(from){
    if(!from){
        Motorway_split();
        Motorway_setDefault();
        Motorway_loadMenu(0);
        Motorway_reload(Motorway_comboGroup[0]);
    }else{
        for(j=0; j<Motorway_comboGroup.length; j++){
            if(Motorway_comboGroup[j]==from) index=j+1;
        if(index<Motorway_comboGroup.length){
            Motorway_tempArray[index].length=0;
            for(i=0;i<Motorway_comboGroup[index-1].options.length;i++){
                if(Motorway_comboGroup[index-1].options[i].selected==true){
                    for(j=0;j<Motorway_tempArray[index-1].length;j++){
                        if(Motorway_comboGroup[index-1].options[i].value==Motorway_tempArray[index-1][j][(index*2 )-1]) Motorway_tempArray[index][Motorway_tempArray[index].length]=Motorway_tempArray[index-1][j ];
        Motorway_loadMenu(index);
        Motorway_reload(Motorway_comboGroup[index]);
function findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
Motorway_makeSelValueGroup("","","","");
Motorway_makeComboGroup("Motorway","Geographic","Carriageway","Lane");
var separator="+#+";
<?php do{?>
Motorway_addContent("<?php echo $row_installed['mway']; ?>+#+<?php echo $row_installed['mway']; ?>+#+<?php echo $row_installed['geographic']; ?>+#+<?php echo $row_installed['geographic']; ?>+#+<?php echo $row_installed['carriageway']; ?>+#+<?php echo $row_installed['carriageway']; ?>+#+<?php echo $row_installed['lane']; ?>+#+<?php echo $row_installed['lane']; ?>");
<?php } while ($row_installed = mysql_fetch_assoc($installed)); ?>
Motorway_reload();
//]]>
      </script>
      <input type="submit" name="Submit" id="Submit" value="Submit" />
      <br />
</form>
    <p> </p>
  </div>
</div>
</body>
</html>
<?php
mysql_free_result($installed);
?>

Similar Messages

  • Adobe Dreamweaver CS3 with ASP coldfusion and PHP search?

    I am working through Adobe Dreamweaver CS3 with ASP
    coldfusion and PHP with the intent of creating a data base site
    that primarily requires a search engine on the index page. The
    search page in the book uses specific search criteria ensuring that
    there will always be a match to the data base but I need to create
    an input text field search engine. My Q, if there is no data within
    the data base that match the variable, will it return with an error
    requiring an argument in the code to respond to no matching data.
    Hopefully there are comprehensive online recourses for these search
    engines as they are so common. I am a complete newby to all aspects
    of web development and code so it will need to be a thorough
    explanation, an idiots guide. ANY HELP GREATLY APPRECIATED

    Rob,
    Let me try to answer your questions, understanding that my
    answers are laced with my experience and therefore my bias.
    1. For the most part the SQL that you write for Access, MS
    SQL or MySQL is going to be the same. I won't make that claim about
    Oracle or PostgreSQL because I have limited or no experience in
    those areas. To be sure when you head down the road with any DBMS
    there are finer points on 'value added' features (to over simplify
    things like MS SQL's Transact SQL), but for the most part when you
    are pulling out, inserting or deleting records the SQL that you
    write will be the same. In fact, I don't think I had to make any of
    the SQL in the book different to deal with the back end db.
    2. As for your host steering you away from MySQL, I don't
    know why that would be. It is MUCH more stable and robust than
    Access for web development. My research showed that you can use
    MySQL just fine with ASP though that clearly wouldn't be
    Microsoft's first choice.
    3. A quick aside, the fact that you are building ASP on a Mac
    would seem to indicate that you are developing on your production
    server. That's never a good idea. Go local if you can. If you have
    a newer Intel Mac you can use VM Fusion, Parallels or even Boot
    Camp to run Windows in a virtual environment and develop there,
    only moving your code to production when you are happy with it.
    There is of course the fact that they two environments would not be
    identical and you may need to change a few references, but it is
    still a better practice than developing on your live site. Some web
    hosts give you the ability to set up a subdomain. If yours does,
    you could set one up with a duplicate of your site and develop
    there.
    4. Let me try to pull your 'rant-let' apart into two issue. I
    begin with a question. I'm not sure what the Mac part has to do
    with it. The primary language I work in at my day job is
    ColdFusion. The majority of the most serious developers I know in
    the CF world work on Macs. I am forced into the PC world because of
    a cultural bias at the business school where I work. Having said
    that, the only time I have felt there was ANY difference in the
    tools, resources, choices I had was in any way affected by platform
    was when Adobe still had not released Flex Builder 2 for the Mac.
    Now that is behind us as well. This reaction of mine may be based
    on the fact that Access never comes into play in the work that I
    do. I regularly work with MS SQL and MySQL. (OK, so SQL Enterprise
    Manager, the MS tool of choice to talk to MS SQL is Windows only,
    but I only use that at the day job. But even there you can find
    cross-platform, free tools like Aqua Data Studio to talk from a Mac
    to MS SQL.) If I'm missing your point on the Mac, please let me
    know. Since the advent of the Intel Mac I think it is hands-down
    the best choice for a web developer. You can have Mac, Windows and
    Unix all on one machine. It doesn't get any better (providing you
    have the RAM :-)).
    As for the security question, it is somewhat analogous to the
    war on viruses and spyware. As the defenses get better, so do the
    attacks. Most languages have developed functions for vetting user
    input variables and best practices for building these things. It is
    mainly a user education issue. When I took over the book you are
    working out of, the one thing Jeffrey told me it needed was more
    security. I did my best to put more in under the constraints of the
    publisher. They didn't want the book to be any longer than the
    previous version. I did my best to modify the code used to include
    "string safe" functions and to add verbiage about the importance of
    security. It was clear that I could not add as much as was needed
    and I said so in the book. Much more is needed for a serious
    treatment of the subject and not acknowledging that would have been
    a disservice to the readers. I've been working as a developer for
    over a decade and I don't know all there is to know about it. It's
    a constantly changing field, just like all of web development. In
    fact next week I'm going through a 2-day SANS Web Application
    Security workshop in hopes of learning more. So at the risk of
    sounding like an industry apologist, I don't think it's a
    shortcoming of the development community. It is, as they say, "a
    developing situation".
    HTH,
    Bob
    http://bobflynn.info/

  • A php search engine that only shows results that match entire serch string

    I have set up a dreamweaver search engine through php and a fulltext search (WHERE MATCH (....) AGAINST (...). However, when someone inputs more than one word into the search form, the search engine churns out results that only have one of those words. How do I get it to only show results that have all the search string words inside? (or, at least, how do I get those results to show up at the top?)
    I have seen some advice (here) that uses php code to process the search query, divide up the words, and place a BOOLEAN '+' between each of the words. By doing this, the search engine will only show results that fully match all the terms.
    My problem is that I do not know how to put this code into my Dreamweaver-created code.
    My dreamweaver created code:
    <?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;
    $form_rsSearch = "-1";
    if (isset($_get['search'])) {
      $form_rsSearch = $_get['search'];
    mysql_select_db($database_dataConnect, $dataConnect);
    $query_rsSearch = sprintf("SELECT title, content FROM encyclopedia WHERE MATCH (title, content) AGAINST (%s)", GetSQLValueString($form_rsSearch, "text"));
    $rsSearch = mysql_query($query_rsSearch, $dataConnect) or die(mysql_error());
    $row_rsSearch = mysql_fetch_assoc($rsSearch);
    $totalRows_rsSearch = mysql_num_rows($rsSearch);
    $input_rsSearchResults = "-1";
    if (isset($_GET['search'])) {
      $input_rsSearchResults = $_GET['search'];
    mysql_select_db($database_EMdataConnect, $dataConnect);
    $query_rsSearchResults = sprintf("SELECT title, content FROM encyclopedia WHERE MATCH(title, content) AGAINST(%s)", GetSQLValueString($input_rsSearchResults, "text"));
    $rsSearchResults = mysql_query($query_rsSearchResults, $dataConnect) or die(mysql_error());
    $row_rsSearchResults = mysql_fetch_assoc($rsSearchResults);
    ?>
    and the code the website (link above) gives is:
    function search(String $search_string) {
         //strip Boolean search characters out of search string
         $search_string = string_replace($search_string,"+","");
         $search_string = string_replace($search_string,"-","");
         $search_string = string_replace($search_string,"*","");
         //split the search string up into an array of words
         Array $tokenized_search = split($search_string, " ");
         //init an empty final search string
         String $processed_search = "";
         //for each word in the search, wrap it
         //with an + and * character and then append
         //it to the processed_search variable
         foreach($tokenized_search as $token) {
              $processed_search+="+"+$token+"* ";
         //build the sql for the query and query the DB
         String $db_query = "select id, description
              from product_descriptions
              where MATCH(description)
              AGAINST ('"+$processed_search+"' IN BOOLEAN MODE)";
         Array results = execute_database_query($db_query);
         return results;
    If anyone can instruct me on the correct way to go about this, I would be very much obliged.
    Thank you,
    YWSW

    Don't use the Search bar, type the address in the Location bar.

  • PHP & Search engines

    Do search engines recognize text that is retrieved from a
    MySQL database with PHP?

    > I think a robot (spider)
    > can get to any page on your site if its on your sever?
    Nonsense. If there's no link to it, then it can only be found
    by a lucky
    guess.
    > But the CAPTCHA is no longer secure
    If done right it is.
    > How do the mail spam bots get in they have to login
    first, right?
    Impossible.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "Baxter" <baxter(RemoveThe :-)@gtlakes.com> wrote in
    message
    news:[email protected]...
    >I don't know? But the CAPTCHA is no longer secure, I
    think a robot
    >(spider)
    > can get to any page on your site if its on your sever?
    How do the mail
    > spam
    > bots get in they have to login first, right?
    > Thanks for your info on this,
    > Dave
    > "Murray *ACE*" <[email protected]>
    wrote in message
    > news:[email protected]...
    >> Such pages are secure. How would the spider login?
    >>
    >> --
    >> Murray --- ICQ 71997575
    >> Adobe Community Expert
    >> (If you *MUST* email me, don't LAUGH when you do
    so!)
    >> ==================
    >>
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    >>
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    >> ==================
    >>
    >>
    >> "Baxter" <baxter(RemoveThe :-)@gtlakes.com>
    wrote in message
    >> news:[email protected]...
    >> > Yes that's what I mean, If you have to login to
    get to the page with
    >> > the
    >> > database info or there is no link to the page
    they will not index it?
    >> > Thanks
    >> > I think that is what I was looking for.
    >> > Dave
    >> > "Murray *ACE*"
    <[email protected]> wrote in message
    >> > news:[email protected]...
    >> >> If you can see it in your browser, they can
    read it. But - they
    >> >> cannot
    >> >> enter information in forms or use logins
    and passwords, if that's what
    >> >> you
    >> >> mean.
    >> >>
    >> >> --
    >> >> Murray --- ICQ 71997575
    >> >> Adobe Community Expert
    >> >> (If you *MUST* email me, don't LAUGH when
    you do so!)
    >> >> ==================
    >> >>
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    >> >>
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    >> >> ==================
    >> >>
    >> >>
    >> >> "bregent"
    <[email protected]> wrote in message
    >> >> news:[email protected]...
    >> >> > >Then they must have some way to
    not index pages with sensitive data
    > on
    >> >> > >them
    >> >> > >is that what your saying. I know
    they can index the php, asp pages
    > but
    >> >> > >what
    >> >> > >about the data that the page
    produces?
    >> >> >
    >> >> > Not sure what you are asking about
    sensitive data. They read pages
    > the
    >> >> > same
    >> >> > way they are rendered to browsers and
    follow the links on the pages.
    >> > They
    >> >> > don't
    >> >> > know if the text is coming from a
    database or is static. They don't
    >> >> > care
    >> >> > if the
    >> >> > data is sensitive or not. Look at the
    source view of a dynamic web
    >> >> > page.
    >> >> > That
    >> >> > is what the SE sees.
    >> >> >
    >> >>
    >> >
    >> >
    >>
    >
    >

  • Php search box - keywords

    Hi I have been searching on php.net and getting confused as
    to what is best for this.
    I have an advanced search which is fine but for my keywords
    search box I am wanting to remove odd spaces and character placed
    e.g. a plus sign or a comma etc.
    If I use a preg_replace() I am not sure what to use, I also
    read about str_replace() and getting confused.
    Any suggestions are welcome.
    I know how to use trim() but I need more than that for this
    instance.
    Thanks for your time....

    Hi David I have tried the above and just a few questions.
    I used the php debugger and I kept getting Undefined Index
    with the SearchString code but now that is fixed.
    Just wondering if the first search box results isn't on the
    same page, using the
    print_r($cleanArray);
    would I place this on the results page to see. As it is at
    the moment it still allows me to place spaces, commas etc.
    I will show you what I have done. Also should I place this as
    a function or leave as is? I have a the search box show up again on
    the results page.
    I did notice since I placed this code that the page loads in
    slower than before.
    <?php
    if (array_key_exists('Search', $_GET)) {
    $SearchString = $_GET['SearchString'];
    $unwanted = array('/\+/', '/,/');
    // replace + and commas with a space
    $clean = preg_replace($unwanted, ' ', $SearchString);
    // use space to create an array from the cleaned-up text
    $clean = explode(' ', $clean);
    // initialize an empty array
    $cleanArray = array();
    // loop through the array to reject empty elements
    foreach ($clean as $item) {
    // empty items return false, so add only if something is
    there
    if ($item)
    array_push($cleanArray, $item);
    // examine the resulting array
    print_r($cleanArray);
    ?>
    This is the search box:
    <table width="100%" border="0" cellpadding="2"
    cellspacing="0" bgcolor="#1F1F1F">
    <tr>
    <td><input name="SearchString" type="text"
    class="search" id="SearchString" value="<?php if
    (isset($_GET['SearchString'])) {
    echo htmlentities($_GET['SearchString']);} ?>" size="26"
    maxlength="26" />
    <input name="Search" type="submit" id="Search"
    style="padding:0;background-color:#000000;border: 1px solid
    #990000;color:#FFFFFF;width:35px;font-weight:bold" value="Go"
    /></td>
    </tr>
    </table>
    I haven't supplied the form code - not necessary.
    The CSS you see for the button is only for the button, the
    CSS for everything else is in a style sheet.
    Every button has a different size that is why.
    <?php echo $_GET['SearchString']; ?> is what is on the
    search results page.
    Thanks for your help.

  • PHP Search Engine

    I made a search engine to search my database for particular things.
    I know this makes it search by name
    $query .= "name LIKE '%$each%' ";
    What would I need to do to make it search for more stuff? Like by  genre
    I already have everything complete, I just need the search engine to search for more than just name.

    These kinds of questions would ordinarily be best posted on the DW Application Development forum (http://forums.adobe.com/community/dreamweaver/dreamweaver_development), not here.  However, I'll give it a go -
    Your question is a bit vague, but how about this -
    $query .= "name LIKE '%$each%' AND title LIKE '%$title%' AND goober LIKE '%$whatever%' ";

  • PHP Search for rows given an array of ID's

    Given an arbitrarily large array of ID's, I want to search an Oracle table for each row based on the ID's in said array and return the results. I can't find a decent way to do this, however, as the array can contain thousands upon thousands of ID's. Obviously, "WHERE IN ()" would not work, as the array can be much larger than 1000.
    Initially, I tried to insert all of the ID's into a global temporary table to do an inner join against but I cannot seem to get this to work. I believe the size of the query gets too large? I have been banging my head against the wall on this for a while and all I can find online is the solutions that work for inserting only a relatively small number of rows, "INSERT ALL" for example.
    I can't be the first person in the world who has needed to do a search based on an array of ID's. Can anyone help me?

    I attempted it using 50 ID's using the following syntax:
    $sql = "INSERT ALL";
    foreach ($entityIdList as $entityId)
    $sql .= " INTO TEMP_ENTITY_TABLE (ENTITY_ID) VALUES ('{$entityId}')";
    $sql .= " SELECT 1 FROM DUAL";
    I run this code and get no errors but when I try to fetch the results by using fetchAll("SELECT * FROM TEMP_ENTITY_TABLE") I just get an empty array returned.
    I thought maybe this was due to the rows being deleted prior to the select executing (I did not specify "PRESERVE ROWS" I will note) so I attempted the query in SQLPlus to see what was happening. It was SQLPlus that told me my query was too long (>2499 characters) and failed out. I thought perhaps the query in code was also getting way too long to be an efficient means of inserting the rows.
    Also, the results of the query you posted are:
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE 11.2.0.3.0 Production
    TNS for Linux: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production

  • Need some help with PHP search engine

    I am working on a search engine for my site that searches for
    terms in my Submissions database. On the results page, I want to
    categorize the results into different sections, depending on the
    submission type. For example, there would be sections for audio
    results, image results, and video results.
    Below is the code I am working with. I copied it from a
    tutorial and modified it a bit to work with my site, so I don't
    completely understand it. What I have here seems to work just fine,
    but this only shows audio results. I want to make queries for other
    submission types as well, but I don't know how. My methods keep
    failing, so I am hoping to get some help here.

    I am working on a search engine for my site that searches for
    terms in my Submissions database. On the results page, I want to
    categorize the results into different sections, depending on the
    submission type. For example, there would be sections for audio
    results, image results, and video results.
    Below is the code I am working with. I copied it from a
    tutorial and modified it a bit to work with my site, so I don't
    completely understand it. What I have here seems to work just fine,
    but this only shows audio results. I want to make queries for other
    submission types as well, but I don't know how. My methods keep
    failing, so I am hoping to get some help here.

  • My iPhoto library has suddenly disappeared from my computer. When i click on iPhoto it tells me to choose my library or create a new one. However no library option appears. I have searched the computer for the library but it does not seem to exist

    My iPhoto library has suddenly disappeared from my computer.
    When i click on iPhoto it tells me to choose my library or create a new one. However no library option appears. I have searched the computer for the library but it does not seem to exist anymore. I did not have time machine set up, so there is no back up. Is there any way i can retrieve my library?
    Here is a picture of what appears when i click on iPhoto:

    In terms of searching i have searched for photos on my finder. However, none of the photos that appear are from my iPhoto Library.
    Search with FindAnyFile. You can download it here:   http://apps.tempel.org/FindAnyFile/index.php
    Search for any file with "ThumbJPGSegment" in the name. If you added at least one image to your library, the library should contain a file with this name, see OldToad's post: Re: Since I updated to iPhoto 9.5.1, my library is not listed or available. How can I find it? Can I use the time machine to restore it?

  • HTML or PHP visibility div tag problem in IE

    Hi,
    I have a PHP search function on a travel site a programmer
    did for me. When you look at it in FF and Safari, it looks fine.
    But in IE, there is a big blank space where the calendar function
    goes. He has the div tag set to visibility:hidden. Any ideas how to
    make it look right in IE as well?? Any help would be appreciated!
    The PHP code is below:
    He thinks the problem is here in this part of the code:
    <div id="kalendar" style="visibility:hidden; width:0px;
    height:0px; border:0;">
    //then goes some tables
    </div>
    Any help would be much appreciated...we are stumped!
    Thanks

    >
    http://www.bluehippotravel.com/surfingvacations
    404 on that link.
    > Does this tell you anything?
    Unfortunately, yes. The person who coded this has no sense of
    best practice
    in HTML authoring....
    I'd like to see the page in the wild if I could - can you
    investigate the
    404, please?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "Lvanhoff" <[email protected]> wrote in
    message
    news:[email protected]...
    > Murray,
    > As always you are a genius :-)
    >
    > The only problem I still have, and only in IE, not FF,
    is that the drop
    > down
    > menus are cutting part of themselves off...any idea why?
    >
    http://www.bluehippotravel.com/surfingvacations
    > Top left...see how the arrows are cut off on the drop
    downs?
    >
    > Not sure if its ok to post to page??
    >
    > I didn't do this part of the page...so not sure how it
    was done...
    > Does this tell you anything?
    >
    > <table bgcolor="#f7ebb3" class="search"
    style="table-layout: fixed;
    > padding:0px" border="0">
    > <tr><td colspan="4" width="auto">
    > <select size="1" class="search" id="country"
    > onchange="javascript:listajzemlje(this.value)">
    > <?php
    > drzave();
    > ?>
    > </select>
    > </td></tr>
    > <tr><td colspan="4" width="auto">
    > <div id="state1">
    > <input type="hidden" id="state" value="" >
    > <input type="hidden" id="city" value="" >
    >
    > </div></td></tr>
    > <tr>
    >
    >
    > <td colspan="4" width="auto">
    > <input class="search" id="hotel" name="hotel" value="
    Hotel name
    > (optional)" />
    >
    >
    >
    > <tr><td colspan="4" style="cursor:pointer;"
    onClick="showKalendar()"
    > class="search" >
    >
    > <img class="search"
    src="images/btn-hotelmenu-searchbydate.jpg"
    > alt="Search by
    > date (optional) ">
    > </td></tr>
    > <tr><td colspan="4">
    > <div id="kalendar" style="display:none; width:0px;
    height:0px;
    > border:0;layout:fixed">
    >
    > <table border="0" class="submenucolor" align="center"
    width="auto">
    >
    > <tr>
    > <td></td><td></td>
    > <td class="HotelSearchMenu" colspan="2"
    align="right">In:<?
    > $aCalendarParams=array(
    > "sIconPath" => "./img/calendar.png",
    > "iAction" => 1, //0=>reloadCurrentPage with get
    param sDate,
    > 1=>fill
    > field sFieldName
    > "sFieldName" => "DPC_date1",
    > "iStyle" => 1, //0=>display calendar,
    1=>display div on icon
    > click
    > "aMonthNames" => $aMonthNames["EN"],
    > "aDaysNames" => $aDaysNames["EN"],
    > "sDateFormat" => $sDateFormat["EN"]
    >
    > );
    > new oCalendarPicker("calFixe1",$sDate,$aCalendarParams);
    > ?></td>
    >
    >
    >
    >
    >
    > </tr>
    >
    >
    > Thanks!
    >

  • Search/Result page is incorrect, result page is blank

    Hello,
    I am designing a website for my work. Iam not very much familiar with coding and dont know what exactly is missing in the code.
    The search page filters the search criteria and on clicking the submit button, redirects to the result page which should display only the rows containing the search criteria. However, it is displaying blank in the result page with only the column names of the queried table (in the recordset)
    The search page code is :
    <?php require_once('Connections/connect.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;
    $colname_Recordset1 = "-1";
    if (isset($_GET['Class'])) {
      $colname_Recordset1 = $_GET['Class'];
    mysql_select_db($database_connect, $connect);
    $query_Recordset1 = sprintf("SELECT * FROM time_table WHERE `Class` = %s", GetSQLValueString($colname_Recordset1, "text"));
    $Recordset1 = mysql_query($query_Recordset1, $connect) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    $colname_Recordset1 = "-1";
    mysql_select_db($database_connect, $connect);
    $query_Recordset1 = sprintf("SELECT * FROM time_table WHERE `Class` = %s", GetSQLValueString($colname_Recordset1, "text"));
    $Recordset1 = mysql_query($query_Recordset1, $connect) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    $totalRows_Recordset1 = "-1";
    if (isset($_GET['Class'])) {
      $totalRows_Recordset1 = $_GET['Class'];
    $colname_Recordset1 = "-1";
    mysql_select_db($database_connect, $connect);
    $query_Recordset1 = sprintf("SELECT * FROM time_table WHERE `Class` = %s", GetSQLValueString($colname_Recordset1, "text"));
    $Recordset1 = mysql_query($query_Recordset1, $connect) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    $totalRows_Recordset1 = "-1";
    if (isset($_GET['Class'])) {
      $totalRows_Recordset1 = $_GET['Class'];
    $colname_Recordset1 = "-1";
    mysql_select_db($database_connect, $connect);
    $query_Recordset1 = sprintf("SELECT * FROM time_table WHERE `Class` = %s", GetSQLValueString($colname_Recordset1, "text"));
    $Recordset1 = mysql_query($query_Recordset1, $connect) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    mysql_select_db($database_connect, $connect);
    $query_Recordset1 = "SELECT * FROM time_table";
    $Recordset1 = mysql_query($query_Recordset1, $connect) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    $totalRows_Recordset1 = "-1";
    if (isset($_GET['Class'])) {
      $totalRows_Recordset1 = $_GET['Class'];
    $colname_Recordset1 = "-1";
    if (isset($_GET['Class'])) {
      $colname_Recordset1 = $_GET['Class'];
    mysql_select_db($database_connect, $connect);
    $query_Recordset1 = sprintf("SELECT * FROM time_table WHERE `Class` = %s", GetSQLValueString($colname_Recordset1, "text"));
    $Recordset1 = mysql_query($query_Recordset1, $connect) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    $totalRows_Recordset1 = mysql_num_rows($Recordset1);$colname_Recordset1 = "-1";
    if (isset($_GET['Class'])) {
      $colname_Recordset1 = $_GET['Class'];
    mysql_select_db($database_connect, $connect);
    $query_Recordset1 = sprintf("SELECT * FROM time_table WHERE `Class` = %s", GetSQLValueString($colname_Recordset1, "text"));
    $Recordset1 = mysql_query($query_Recordset1, $connect) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    $totalRows_Recordset1 = mysql_num_rows($Recordset1);
    $query_Recordset1 = "SELECT distinct `Class` FROM time_table";
    $Recordset1 = mysql_query($query_Recordset1, $connect) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    ?>
    <?php
    // *** Validate request to login to this site.
    if (!isset($_SESSION)) {
      session_start();
    $loginFormAction = $_SERVER['PHP_SELF'];
    if (isset($_GET['accesscheck'])) {
      $_SESSION['PrevUrl'] = $_GET['accesscheck'];
    if (isset($_POST['Rid'])) {
      $loginUsername=$_POST['Rid'];
      $password=$_POST['textfield'];
      $MM_fldUserAuthorization = "";
      $MM_redirectLoginSuccess = "index_1 - Copy.php";
      $MM_redirectLoginFailed = "login_2.php";
      $MM_redirecttoReferrer = false;
      mysql_select_db($database_connect, $connect);
      $LoginRS__query=sprintf("SELECT reg_no, password FROM login_table WHERE reg_no=%s AND password=%s",
        GetSQLValueString($loginUsername, "int"), GetSQLValueString($password, "text"));
      $LoginRS = mysql_query($LoginRS__query, $connect) or die(mysql_error());
      $loginFoundUser = mysql_num_rows($LoginRS);
      if ($loginFoundUser) {
         $loginStrGroup = "";
              if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();}
        //declare two session variables and assign them
        $_SESSION['MM_Username'] = $loginUsername;
        $_SESSION['MM_UserGroup'] = $loginStrGroup;               
        if (isset($_SESSION['PrevUrl']) && false) {
          $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
        header("Location: " . $MM_redirectLoginSuccess );
      else {
        header("Location: ". $MM_redirectLoginFailed );
    ?>
    <!doctype html>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>TIME TABLE</title>
    <link rel="stylesheet" href="styles.css" type="text/css" />
    </head>
    <body onsubmit= "registerEvents()">
                                             <form name="form1" method="POST" action="<?php echo $loginFormAction; ?>">
    </form>
                                             <img class="header-image" src="images/logowhite.jpg"  style="float: left" />                    
      <header>
                  <h1><a href="/">CHRIST PRE-UNIVERSITY<span>E-SCHOOL</span></a></h1>
            <h2>EXCELLENCE IS ALL THAT MATTERS</h2>
        </header>
        <div id="body">
            <form name="form2" method="get" action="time.php">
              <p align="center">
                <strong>
                <label for="Rid">
                   <br>
                </label>
                <label for="Rid"><br>
                </label>
                <label for="sid">Class</label>
                <select name="sid" id="sid">
                  <?php
    do { 
    ?>
                  <option value="<?php echo $row_Recordset1['Class']?>"<?php if (!(strcmp($row_Recordset1['Class'], ucwords($row_Recordset1['Class'])))) {echo "selected=\"selected\"";} ?>><?php echo $row_Recordset1['Class']?></option>
                  <?php
    } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));
      $rows = mysql_num_rows($Recordset1);
      if($rows > 0) {
          mysql_data_seek($Recordset1, 0);
                $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    ?>
                </select>
                <label for="Rid"><br>
                </label>
                </strong></p>
              <p align="center">
                <input name="Submit" type="submit" class="formbutton" id="Submit" value="Submit" >
              </p>
            </form>
            <section id="content">
                  <article></article>
            </section>
    </div>
    </body>
    </html>
    <?php
    mysql_free_result($Recordset1);
    ?>
    The result page code is:
    <?php require_once('Connections/connect.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;
    }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_Recordset1 = 10;
    $pageNum_Recordset1 = 0;
    if (isset($_GET['pageNum_Recordset1'])) {
      $pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
    $startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
    $colname_Recordset1 = "-1";
    if (isset($_GET['Class'])) {
      $colname_Recordset1 = $_GET['Class'];
    mysql_select_db($database_connect, $connect);
    $query_Recordset1 = sprintf("SELECT * FROM time_table WHERE `Class` = %s", GetSQLValueString($colname_Recordset1, "text"));
    $query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
    $Recordset1 = mysql_query($query_limit_Recordset1, $connect) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    if (isset($_GET['totalRows_Recordset1'])) {
      $totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
    } else {
      $all_Recordset1 = mysql_query($query_Recordset1);
      $totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
    $totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
    $colname_Recordset1 = "-1";
    if (isset($_GET['Class'])) {
      $colname_Recordset1 = $_GET['Class'];
    mysql_select_db($database_connect, $connect);
    $query_Recordset1 = sprintf("SELECT * FROM time_table WHERE `Class` = %s", GetSQLValueString($colname_Recordset1, "text"));
    $Recordset1 = mysql_query($query_Recordset1, $connect) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    $totalRows_Recordset1 = mysql_num_rows($Recordset1);
    ?>
    <!doctype html>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>TIME TABLE FOR CLASS</title>
    <link rel="stylesheet" href="styles.css" type="text/css" />
    </head>
    <body bgcolor="#CCFF99">
                        <div>
            <img src="images/logowhite.jpg" width="274" height="103" class="header-image"  style="float: left" />                    
    </div>
      <header>
        <h1 align="left"><a href="/"> SCHOOL TIME-TABLE FOR <span> THE CLASS </span></a></h1>
    </header>
      </div>
    <div align="center">
    </div>
        <p align="center"> </p>
    <p align="center"> </p>
        <div align="center">
    <p align="center"> </p>
    <table border="5" cellpadding="15" cellspacing="15">
      <tr>
        <td>Class</td>
        <td>Day</td>
        <td>1st</td>
        <td>2nd</td>
        <td>3rd</td>
        <td>4th</td>
        <td>Room No</td>
      </tr>
      <?php do { ?>
        <tr>
          <td><?php echo $row_Recordset1['Class']; ?></td>
          <td><?php echo $row_Recordset1['Day']; ?></td>
          <td><?php echo $row_Recordset1['1st']; ?></td>
          <td><?php echo $row_Recordset1['2nd']; ?></td>
          <td><?php echo $row_Recordset1['3rd']; ?></td>
          <td><?php echo $row_Recordset1['4th']; ?></td>
          <td><?php echo $row_Recordset1['Room No']; ?></td>
        </tr>
        <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
    </table>
    </body>
    </html>
    <?php
    mysql_free_result($Recordset1);
    ?>
    Please help me out.
    Thanks

    Thanks for your help,
    I have created both the pages again, one is a search.php another is result.php
    search.php is only used for accepting a text field which is the input of the search in database table on click of the button, and the result of the search is to be displayed in a dynamic table in result.php.
    The result field again uses a GET variable named 'Class Name', from the form field in search.php. But again, my result Page displays blank except the column names of the table. Please advice.
    search.php
    <?php require_once('Connections/connect.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;
    ?>
    <!doctype html>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <link rel="stylesheet" href="styles.css" type="text/css" />
    </head>
    <body>
                        <div>
            <img src="images/logowhite.jpg" width="274" height="103" class="header-image"  style="float: left" />                    
    </div>
      <header>
        <h1 align="left"><a href="/"> TIME TABLE FOR<span> CLASS                           </span></a></h1>
    </header>
      </div>
    <div align="center">
        </div>
        <form name="form1" method="get" action="result.php">
          <p><label>Class Name</label>
          <input name="Class Name" type="text" value="" size="15" maxlength="20">
           </p>
          <p>
            <input type="submit" name="bid" id="bid" value="Search">
          </p>
        </form>
        <p align="center"> </p>
    </body>
    </html>
    result.php
    <?php require_once('Connections/connect.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_Recordset1 = 10;
    $pageNum_Recordset1 = 0;
    if (isset($_GET['pageNum_Recordset1'])) {
      $pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
    $startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
    $colname_Recordset1 = "-1";
    if (isset($_GET['Class Name'])) {
      $colname_Recordset1 = $_GET['Class Name'];
    mysql_select_db($database_connect, $connect);
    $query_Recordset1 = sprintf("SELECT * FROM time_table WHERE `Class` LIKE %s ORDER BY `Class` ASC", GetSQLValueString("%" . $colname_Recordset1 . "%", "text"));
    $query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
    $Recordset1 = mysql_query($query_limit_Recordset1, $connect) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    if (isset($_GET['totalRows_Recordset1'])) {
      $totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
    } else {
      $all_Recordset1 = mysql_query($query_Recordset1);
      $totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
    $totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
    ?>
    <!doctype html>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <link rel="stylesheet" href="styles.css" type="text/css" />
    </head>
    <body>
                        <div>
            <img src="images/logowhite.jpg" width="274" height="103" class="header-image"  style="float: left" />                    
    </div>
      <header>
        <h1 align="left"><a href="/"> TIME TABLE SEARCH RESULT FOR<span> CLASS </span></a></h1>
    </header>
      </div>
    <div align="center">
    <table border="5">
      <tr>
        <td>Class</td>
        <td>Day</td>
        <td>1st</td>
        <td>2nd</td>
        <td>3rd</td>
        <td>4th</td>
        <td>Room No</td>
      </tr>
      <?php do { ?>
        <tr>
          <td><?php echo $row_Recordset1['Class']; ?></td>
          <td><?php echo $row_Recordset1['Day']; ?></td>
          <td><?php echo $row_Recordset1['1st']; ?></td>
          <td><?php echo $row_Recordset1['2nd']; ?></td>
          <td><?php echo $row_Recordset1['3rd']; ?></td>
          <td><?php echo $row_Recordset1['4th']; ?></td>
          <td><?php echo $row_Recordset1['Room No']; ?></td>
        </tr>
        <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
    </table>
    <p align="center"> </p>
    </body>
    </html>
    <?php
    mysql_free_result($Recordset1);
    ?>
    </body>
    </html>
    I followed these steps from adobe help.
    Thanks.

  • Flash PHP MySQL issue

    can someone please tell me what i'm doing wrong:
    (Actionscript)
    var db_out:URLVariables = new URLVariables();
    db_out.from = "property";
    db_out.where = "`state`='OR'";
    var db_req:URLRequest = new URLRequest("php/search.php");
    db_req.data = db_out;
    db_req.method = URLRequestMethod.POST;
    ldr_db.load(db_req);
    (PHP)
    $select='`id`';
    $from=$_POST['from'];
    $where=$_POST['where'];
    $order='`type`';
    $result=mysql_query('SELECT '.$select.' FROM `'.$from.'` WHERE '.$where.' ORDER BY '.$order);
    this returns no results.
    this issue is within the db_out.where variable.
    other searches where db_out.where is a Number (IE: where = "`status`=1") work fine.
    so how do i pass a String query from Flash to MySQL?
    if it were a single variable sent to PHP, i would wrap it in single quotes (IE: ''SELECT '.$select.' FROM `'.$from.'` WHERE `state`='."'".$var."'".' ORDER BY '.$order), but how do i properly send a WHERE statement from Flash to MySQL involving a String??
    much appreciated,

    i figured it out. no idea why this is an issue, but it seems to be.
    if Flash passes a string to PHP to be used in a MySQL query, and that string contains single quotes (IE `city`='Portland'), the query will return 0 results, even if its WHERE had an OR conditional in it not using single quotes (IE `status`=1).
    so here's the fix:
    use some unused symbol in place of the single quotes (IE ^) in Flash, and have PHP use str_replace to swap them for single quotes.
    i dont know why PHP has to be the one to implement the single quotes, but it seems to
    IE:
    $where = str_replace('^', "'", $_POST['where']);
    i hope this saves someone the hours i spent trying to figure this one out!!

  • Search Bar Issues MYSQLi

    Hi, Just wondering if someone can have a look at what im doing wrong here?
    PS All connections to the database work.
    I get these three error messages:
    Warning: mysqli_query(): Empty query in /home4/X/public_html/props_inventory.php on line 12
    Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, boolean given in /home4/X/public_html/props_inventory.php on line 13
    Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, boolean given in /home4/X/public_html/props_inventory.php on line 363
    <?php
    //Main Connection & Query
    //Database Connection & Error
    $con_host = 'X';
    $con_username = 'X';
    $con_password = 'X';
    $con_database = 'X';
    $con = mysqli_connect($con_host, $con_username, $con_password, $con_database);
    //Main Query (on page load [Shows all records])
    $sql = mysqli_query($con, $sql_search);
    $row = mysqli_fetch_assoc($sql);
    //Set production info variables
    $prop_id = $row['id'];
    $prop_title = $row['title'];
    $prop_description = $row['description'];
    $prop_colour = $row['colour'];
    $prop_type = $row['type'];
    $prop_size = $row['size'];
    $prop_weight = $row['weight'];
    $prop_material = $row['material'];
    $prop_value = $row['value'];
    $prop_location = $row['location'];
    $prop_sublocation = $row['sublocation'];
    $prop_quantity = $row['quantity'];
    $prop_bc = $row['BC'];
    $prop_datecreated = $row['datecreated'];
    ?>
    <?php
    //Search Bar
    if($_POST['txt_search']) {
    $search = $_POST['txt_search'];
    elseif($_GET['searchprops']) {
    $search = $_GET['searchprops'];
    if (isset($search))
      $searchword = $search;
      $query_props = "SELECT * FROM props WHERE id LIKE '%".$searchword."%' OR name LIKE '%".$searchword."%' OR description LIKE '%".$searchword."%' OR colour LIKE '%".$searchword."%' OR type LIKE '%".$searchword."%' OR size LIKE '%".$searchword."%' OR weight LIKE '%".$searchword."%' OR value LIKE '%".$searchword."%' OR location LIKE '%".$searchword."%' OR sublocation LIKE '%".$searchword."%' OR BC LIKE '%".$searchword."%'";
    if(!isset($search)){
      $query_props = "SELECT * FROM props";
    $query_limit_props = sprintf("%s LIMIT %d, %d", $query_props, $startRow_props, $maxRows_props);
    $props = mysqli_query($con, $query_limit_props) or die(mysql_error());
    $row_props = mysqli_fetch_assoc($props);
    ?>

    You have a lot of problems with your script below. First of all, you are using isset() incorrectly. The isset() function only tests if the field is set, not if it is empty. So even if the user doesn't enter anything, if the field is on the form it is set.
    Next, why are you copying the value of one variable into another variable - $searchword = $search; ? What does that accomplish?
    Finally, the argument you are passing to mysqli_num_rows() is a single row. You need to pass it the result set.
    Fixed the main search bar issue, but still having problem with the num_row statement
    Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, array given in /home4/mresnik/public_html/props_inventory.phpon line 47
    <?php
    //Search
    if(isset($_POST['txt_search'])) {
      $search = $_POST['txt_search'];
      $searchword = $search;
      $query_search = "SELECT * FROM props WHERE id LIKE '%".$searchword."%' OR name LIKE '%".$searchword."%' OR description LIKE '%".$searchword."%' OR colour LIKE '%".$searchword."%' OR type LIKE '%".$searchword."%' OR size LIKE '%".$searchword."%' OR weight LIKE '%".$searchword."%' OR value LIKE '%".$searchword."%' OR location LIKE '%".$searchword."%' OR sublocation LIKE '%".$searchword."%' OR BC LIKE '%".$searchword."%'";
    if(!isset($search)){
      $query_search = "SELECT * FROM props";
    $search_query = mysqli_query($con, $query_search);
    $row = mysqli_fetch_assoc($search_query);
    $row_count = mysqli_num_rows($row);
    ?>

  • CSS or JS Navigation Bar with inline Styled Search Field

    Does anyone know of a good tutorial on how to create a CSS or
    JS navigation bar that would contain a matching styled search field
    box?
    I have tried creating something like this a couple of times
    using the old JS Navigation Bar wizard in DW, but can't get the
    results I need. I can never seem to add a column that would include
    a search box and have it look right and inline with the rest of the
    navigation.
    For reference, I am trying to do a nav that is somewhat
    similiar to Apple's Nav bar, where the search field is styled to
    match the rest of the Nav and inline with the rest of the buttons.
    Any thoughts?
    Thanks.

    You don't need to use PMM. You can set your menu container to
    position:
    relative and then absolutely position the search box inside.
    Al Sparber - PVII
    http://www.projectseven.com
    Extending Dreamweaver - Nav Systems | Galleries | Widgets
    Authors: "42nd Street: Mastering the Art of CSS Design"
    "destind4film" <[email protected]> wrote in
    message
    news:fkukir$8l4$[email protected]..
    > Hi Al,
    >
    > Thanks for the quick reply. I had actually checked your
    site earlier
    > today,
    > since I have had such an awesome experience with your
    accordion menus.
    >
    > That example is almost exactly what I am trying to do,
    minus the dropdown
    > menu
    > buttons. The buttons currently are just simple rollovers
    that go directly
    > to
    > other pages, but I am trying to place a styled search
    box to the right
    > like
    > your example has.
    >
    > Here is the current page (also using the PVII Accordion
    Menu) that does
    > not
    > have the search added yet, but you can see that I have
    plenty of real
    > estate to
    > include one:
    >
    >
    http://www.dvdflashbacks.com/mrhubcap/
    >
    > Questions:
    > Can the pop menu be used with my current roll over
    images for basic Nav
    > bars
    > like this?
    > How easy is it to add the search field to this menu?
    (This is a PHP/MySql
    > backend for the site using Cartweaver3. I have a php
    search snippet from
    > CW3
    > that I was trying to stick into a table cell next to
    this nav but the cell
    > would never align properly for some reason.)
    >
    > Thank you very much and Merry 'Belated' Christmas!
    >

  • Difficulty opening a php file in a browser

    Hi thanks for your ideas in advance.
    I am creating a new opening page (using html) for a php site.
    I can't do it in php since i don't know a lick of it. The client
    wants their current php site to remain intact while I add a new
    html landing page to the site. They want to link from this new
    opening page to the current site they have.
    There is not the usual index.html file in the current root
    folder. There is a file called index.php. When I open this with
    Firefox it displays only code. So this is one problem - I don't
    know how to link to a php page so it displays correctly.
    Second question is how can I create an html page to stand as
    an opener to this php site, without recoding the index.php? If I
    must recode it - is that easy enough to do?
    Thank you kindly!

    You could rename the index.php file to something else like
    index2.php,
    search and hope you found all links to that file and changed
    them, then
    upload your new index.html file. But i don't have high hopes.
    Make backup
    copies of the site folder so the client isn't worse off.
    Alan
    Adobe Community Expert, dreamweaver
    http://www.adobe.com/communities/experts/

Maybe you are looking for