PHP Recordset error

When I create a recordset in php it creats a function
GetSQLValueString, which I assume is normal, the problem occurs
when I want to edit that Recordset every time I do it recreates
that function so then I have 2 and so on and so forth.
Deleting the extra functions fixes the problem but it's
really starting to annoy me and I was wondering if this has happen
to any one else and if there was a patch or fix for this?
Thanks

"northpawjustice" <[email protected]> wrote
in message
news:e61l7s$pni$[email protected]..
> When I create a recordset in php it creats a function
GetSQLValueString,
> which
> I assume is normal, the problem occurs when I want to
edit that Recordset
> every
> time I do it recreates that function so then I have 2
and so on and so
> forth.
> Deleting the extra functions fixes the problem but it's
really starting to
> annoy me and I was wondering if this has happen to any
one else and if
> there
> was a patch or fix for this?
Unfortunately, this is the patch. It has a lot of problems.
Other problems
with this function: Dreamweaver adds it whether it's needed
or not, and DW
adds it for every parameter whether you want to use it or
not. It also
prevents the use of dynamic SQL and dynamic sorting.
Tom

Similar Messages

  • PHP recordset odd behavior

    I am an instructor at a technical college and I am using the
    Dreamweaver 8 with ASP, Coldfusion, and PHP training form the
    source book in my class. We are experiencing a strange issue when
    trying to create a PHP recordset.
    On page 310, when creating a recordset everything is fine
    except for one table in the database. We can see all 6 tables in
    the drop down list and can choose any one except tbl_tours. If we
    choose that one table we get an Unidentified Error message when
    testing the query. The really strange thing is we have already
    created recordsets from this table in previous lessons with no
    problem.
    Any ideas?
    Thanks
    Bongo

    On Thu, 11 Oct 2007 20:47:04 +0000 (UTC), "paulelwood"
    <[email protected]> wrote:
    > what I need to do is to display a field based on the
    user and password on the
    >receiving page, but I can't seem to get that to work. If
    I get rid of the
    >built-in user authentication and just send the login and
    password to the
    >receiving page as form variables, it works fine but then
    I don't have the error
    >page behavior. I'm not a database guy, just kind of
    floundering here.Any help
    >gratefully accepted.
    Not quite sure what you mean ("display a field") but it
    sounds like
    you want the receiving page to display some information about
    the
    person who has logged in?
    In that case, in the code on your login page, after login has
    been
    verified but before the redirection to the receiving page,
    you should
    set a session variable to be the id of the person logging in.
    Then on
    your receiving page query the database for the person with
    that id and
    retrieve whatever you want. For example, get their given name
    and
    display a personalised welcome to them.
    Hope this is what you meant?
    Steve Fleischer
    steve at flyingtigerwebdesign dot com
    Hong Kong

  • PHP Fatal error

    I'm trying to work with CS3 and am designing a form to submit
    some data to the database and when I attempt to look at the page I
    get the following error:
    PHP Fatal error: Call to undefined function mysql_pconnect()
    What should I do? I don't have control over the server... so
    I really cant make configuration changes...
    all I get is a blank page the second I add a recordset...
    Help!!!
    -Warren

    AFAIK, establishing a persistent connection to a MySQL server
    (that´s what
    pconnect stands for) will only work on servers where PHP
    has been installed as Apache "module" --- seems that the remote
    server has it installed as CGI.
    Guess you´ll need to resort to using a regular
    non-persistent connection, means "mysql_connect()"
    works better ?

  • ActionScript 3 + PHP: TypeError: Error #2007: Parameter text must be non-null.

    Hi - Still new to flash as3 and php -
    it is a contact form page - user puts in information - i am to receive it in an email address their information
    as well the variables get sent back from the php to the .swf file.
    I am receiving these errors and not knowing how to fix them.
    any help would be much appreciated. thank you in advance really.
    below are the errors in flash - as3 code - and php code setup.
    errors:
    ActionScript 3 + PHP: TypeError: Error #2007: Parameter text must be non-null:
      at flash.text::TextField/set text()
              at kwangjaekim_fla::wholeform_16/completeHandler()
              at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
              at flash.events::EventDispatcher/dispatchEvent()
              at flash.net::URLLoader/flash.net:URLLoader::onComplete()
    my as3 code is the following:
    // build variable name for the URL Variables loader
    var variables:URLVariables = new URLVariables();
    //Build the varSend variable
    var varSend:URLRequest = new URLRequest("contact_parse.php");
    varSend.method = URLRequestMethod.POST;
    varSend.data = variables;
    //Build the varLoader variable
    var varLoader:URLLoader = new URLLoader;
    varLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
    varLoader.addEventListener(Event.COMPLETE, completeHandler);
    //handler for the PHP  script completion and return of status
    function completeHandler(event:Event):void{
              //value is cleared at ""
              name_txt.text = "";
              contact_txt.text = "";
              msg_txt.text = "";
              //Load the response PHP here
              status_txt.text = event.target.data.return_msg;
    //Add event listener for submit button click
    submit_btn.addEventListener(MouseEvent.CLICK, ValidateAndSend);
    //function ValidateAndSend
    function ValidateAndSend(event:MouseEvent):void{
              //validate fields
              if(!name_txt.length){
                        status_txt.text = "Please Enter Your Name";
              }else if(!contact_txt.length){
                        status_txt.text = "Please Enter Your Contact Detail";
              }else if(!msg_txt.length){
                        status_txt.text = "Please Enter Your Message";
              }else {
              // ready the variables in form for sending
      variables.userName = name_txt.text;
              variables.userContact = contact_txt.text;
              variables.userMsg = msg_txt.text;
              // Send the data to PHP now
    varLoader.load(varSend);
    submit_btn.addEventListener(MouseEvent.CLICK, function(){MovieClip(parent).gotoAndPlay(151)});
              } // Close else condition for error handling
    } // Close validate and send function
    my php code is the following:
    <?php
    // Create local PHP variables from the info the user gave in the Flash form
    $senderName   = $_POST['userName'];
    $senderEmail     = $_POST['userContact'];
    $senderMessage = $_POST['userMsg'];
    // Strip slashes on the Local variables
    $senderName   = stripslashes($senderName);
    $senderContact     = stripslashes($senderContact);
    $senderMessage   = stripslashes($senderMessage);
    //!!!!!!!!!!!!!!!!!!!!!!!!!     change this to my email address     !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
                              $to = "put iny me email address";
         // Place sender Email address here
        $from = "$senderContact ";
        $subject = "Contact from your site";
        //Begin HTML Email Message
        $message = <<<EOF
    <html>
      <body bgcolor="#FFFFFF">
    <b>Name</b> = $senderName<br /><br />
    <b>Contact</b> = <a href="mailto:$senderContact">$senderEmail</a><br /><br />
    <b>Message</b> = $senderMessage<br />
      </body>
    </html>
    EOF;
       //end of message
        $headers  = "From: $from\r\n";
        $headers .= "Content-type: text/html\r\n";
        $to = "$to";
        mail($to, $subject, $message, $headers);
    exit();
    ?>
    thank you once again
    jay

    thank you Ned -
    i put in the trace line as you mentioned -
    and this is what i received -
    returns: undefined
    TypeError: Error #2007: Parameter text must be non-null
              at flash.text::TextField/set text()
              at kwangjaekim_fla::wholeform_16/completeHandler()
              at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
              at flash.events::EventDispatcher/dispatchEvent()
              at flash.net::URLLoader/flash.net:URLLoader::onComplete()
    what does this mean exactly?
    thank you for the help really

  • Spry widget / php recordsets / repeatable regions

    okay this deals with the spry collapsiblepanel widget in cs3.
    I'm testing the ability to create a news feed with this feature
    paired with a php recordset. My issue involves the repeated widgets
    not working like the first one. I know it probably is a result of
    the region thats being repeated / the collapsible panel. Look at
    the code and this test site that i've worked up.
    test website the
    code is below...i've commented out the start and end of the
    repeated region.

    PHP, being a serverside code, will refresh the page each time there is a request made to the server. JavaScript (and Spry), being a client side code, does not have to send requests to the server and therefore allows you to change the data without a page refresh.
    Having said that, you need to have a Spry dataset in your Accordion panel.
    By following these steps, you will be well on your way to achieving what you want.
    Retrieve your data using PHP and place it in an HTML-table or similar outside of the Accordion panel
    Create a SpryHTMLDataSet based on the HTML-table
    Use the data from the Spry dataset to create a master/detail region in your Accordion panel
    Just a few questions before I go into details.
    Have you set up a connection to a database, thus be able to retrieve the data?
    Why do you need an Accordion panel to show your data?
    Have you got an online URL so that we can follow your code? Otherwise please include your code in your post.
    Please come back here with your answers and we shall try to help you on your way
    Ben

  • Sjsws 7 u1 and PHP 405 errors

    All,
    I have receiving php 405 errors when I run php scripts on sjsws 7 u1. I have downloaded the php add on from sun downloads. Any suggestions on how to make this work. The install script has placed most of the entries I required in the obj.conf, magnus.conf and mime.types files.
    Any help is greatly appreciated.
    Nathan

    Here is my obj.conf:
    # Copyright 2006 Sun Microsystems, Inc. All rights reserved.
    # Use is subject to license terms.
    # You can edit this file, but comments and formatting changes
    # might be lost when you use the administration GUI or CLI.
    <Object name="default">
    Service type="magnus-internal/php"
    fn="responder-fastcgi"
    app-path="/sun/webserver7/plugins/php/bin/php"
    bind-path="localhost:3101"
    app-env="PHPRC=/sun/webserver7/plugins/php"
    app-env="PHP_FCGI_CHILDREN=2"
    app-env="PHP_FCGI_MAX_REQUEST=200"
    app-env="FCGI_WEB_SERVER_ADDRS=127.0.0.1"
    app-env="LD_LIBRARY_PATH=/sun/webserver7/plugins/php"
    app-env="LD_LIBRARY_PATH_64=/sun/webserver7/plugins/php/64"
    AuthTrans fn="match-browser" browser="*MSIE*" ssl-unclean-shutdown="true"
    NameTrans fn="ntrans-j2ee" name="j2ee"
    NameTrans fn="pfx2dir" from="/mc-icons" dir="/sun/webserver7/lib/icons" name="es-internal"
    NameTrans fn="assign-name" from="/fcgi/*" name="fcgi.config"
    PathCheck fn="uri-clean"
    PathCheck fn="find-pathinfo"
    PathCheck fn="find-index-j2ee"
    PathCheck fn="find-index" index-names="index.html,home.html,index.jsp,index.php,default.asp,index.asp"
    ObjectType fn="type-j2ee"
    ObjectType fn="type-by-extension"
    ObjectType fn="force-type" type="text/plain"
    Service method="(GET|HEAD)" type="magnus-internal/directory" fn="index-common"
    Service method="(GET|HEAD|POST)" type="*~magnus-internal/*" fn="send-file"
    Service method="TRACE" fn="service-trace"
    Error fn="error-j2ee"
    AddLog fn="flex-log"
    </Object>
    <Object name="j2ee">
    Service fn="service-j2ee" method="*"
    </Object>
    <Object name="es-internal">
    </Object>
    <Object name="cgi">
    ObjectType fn="force-type" type="magnus-internal/cgi"
    Service fn="send-cgi"
    </Object>
    <Object name="send-precompressed">
    PathCheck fn="find-compressed"
    </Object>
    <Object name="compress-on-demand">
    Output fn="insert-filter" filter="http-compression"
    </Object>
    <Object name="fcgi.config">
    AuthTrans fn="auth-fastcgi" app-path="/fastcgi/apps/c/simpleAuth"
    bind-path="localhost:2111"
    Service fn="responder-fastcgi"
    app-path="/fastcgi_enabled_php_installation_dir/bin/php"
    app-env="name1=abc"
    </object>

  • PHP MySQL Error Code 500

    May be someone can help me out with this problem.
    I have setup a new site using PHP MySQL and Dreamweaver 8.02.
    Dreamweaver connects to the database but after creating a
    recordset the recordset cannot be used.
    instead Dreamweaver returns:
    HTTP Error Code 500 internal Server Error
    Any help will be much appriciated.
    Jos

    Hello,
    I have also had the same error - namely that whilst I could connect via ftp, upload/download files, and view database tables, any attempt to view of modify recordsets resulted in error 500.
    Having checked other potential causes (e.g. selection/non-selection use of passive FTP setting, enabling of php, etc.), on the back of posts here I contacted my host and asked if if could relate to mod security, as further investigation revealed that the issue only occurred on sites where mod security had not been disabled (I don't like to disable mod security for obvious reasons - and I'm told you can't do that site by site with apache2 anyway).
    After a few false starts, the problem was resolved - with the following response from my host: "The false positives were being generated by "/_mmServerScripts/MMHTTPDB.php" and that is what we've worked around in the rules. As such, any domain on [servername] using that script in the same way shouldn't generate a false-positive moving forward."
    So it seems the answer (assuming your on an apache server of course) may be to modify the rules to allow full access for MMHTTPDB.php.
    I hope that is of help to some.

  • PHP/MySql Error Message

    I've posted this before and didn't get the answer that I need, probably because I didn't post all of my codes. I am using PHP/MySql.  I created a website that has several forms.  When I process three of the forms, I get the error messages below:
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Condition, Length, Color, City, `State`, Email, Photo) VALUES ('29', '4', 'Used'' at line 1.
    Below I am posting the codes.  Hopefully, this time I posted everything that I should have so that I can get assistance.   
    FORM
    <form action="<?php echo $editFormAction; ?>" method="POST" enctype="multipart/form-data" name="individual" class="individual" id="individual">
      <table width="594" border="0" class="test">
      <tr></tr>
      <tr>
        <td width="166" class="td">Posting Title</td>
        <td colspan="3"><span id="sprytextfield1">
          <label>
            <input name="Posting Title" type="text" class="test" id="Posting Title" size="35" />
            </label>
          <span class="textfieldRequiredMsg">Required</span></span></td>
      </tr>
      <tr>
        <td class="td">Price</td>
        <td colspan="3"><span id="sprytextfield2">
          <label>
            <input name="price" type="text" class="test" id="price" size="35" />
          </label>
          <span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td>
      </tr>
      <tr>
        <td class="td">Size(s)</td>
        <td colspan="3"><label>
          <select name="size" size="1" multiple="multiple" class="test" id="size">
    <option>0</option>
            <option>2</option>
            <option>4</option>
            <option>6</option>
            <option>8</option>
            <option>10</option>
            <option>12</option>
            <option>14</option>
            <option>16</option>
            <option>18</option>
            <option>20</option>
            <option>22</option>
            <option>24</option>
            <option>26</option>
          </select>
        </label></td>
      </tr>
      <tr>
        <td class="td">Condition</td>
        <td colspan="3"><label>
          <select name="Condition" class="test" id="Condition">
    <option>New</option>
            <option>Used</option>
          </select>
        </label></td>
      </tr>
      <tr>
        <td class="td">Length</td>
        <td colspan="3"><label>
          <select name="Length" class="test" id="Length">
    <option>Long</option>
    <option>Short</option>
    <option>Mid-Length</option>
          </select>
        </label></td>
      </tr>
      <tr>
        <td class="td">Color</td>
        <td colspan="3" class="td"><span id="sprytextfield5">
          <label>
            <input name="Color" type="text" class="test" id="Color" size="35" />
          </label>
          <span class="textfieldRequiredMsg">Required</span></span></td>
      </tr>
      <tr>
        <td class="td">City</td>
        <td class="td"><span id="sprytextfield4">
          <label>
            <input name="City" type="text" class="test" id="City" size="35" />
          </label>
          <span class="textfieldRequiredMsg">Required</span></span></td>
        <td class="td"> </td>
        <td class="td"> </td>
      </tr>
      <tr>
        <td class="td">State</td>
        <td colspan="3"><label>
          <select name="State" class="test" id="State">
            <option>AL</option>
            <option>AK</option>
            <option>AZ</option>
            <option>AR</option>
            <option>CA</option>
            <option>CO</option>
            <option>CT</option>
            <option>DE</option>
            <option>DC</option>
            <option>FL</option>
            <option>GA</option>
            <option>HI</option>
            <option>ID</option>
            <option>IL</option>
            <option>IN</option>
            <option>IA</option>
            <option>KS</option>
            <option>KY</option>
            <option>LA</option>
            <option>ME</option>
            <option>MD</option>
            <option>MA</option>
            <option>MI</option>
            <option>MN</option>
            <option>MS</option>
            <option>MO</option>
            <option>MT</option>
            <option>NE</option>
            <option>NV</option>
            <option>NH</option>
            <option>NJ</option>
            <option>NM</option>
            <option>NY</option>
            <option>NC</option>
            <option>ND</option>
            <option>OH</option>
            <option>OK</option>
            <option>OR</option>
            <option>PA</option>
            <option>RI</option>
            <option>SC</option>
            <option>SD</option>
            <option>TN</option>
            <option>TX</option>
            <option>UT</option>
            <option>VT</option>
            <option>VA</option>
            <option>WA</option>
            <option>WV</option>
            <option>WI</option>
            <option>WY</option>
          </select>
        </label></td>
      </tr>
      <tr>
        <td class="td">Email</td>
        <td colspan="3"><span id="sprytextfield3">
          <label>
            <input name="Email" type="text" class="test" id="Email" size="35" />
          </label>
          <span class="textfieldRequiredMsg">Required</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td>
      </tr>
      <tr>
        <td height="26" class="td">Confirm Email</td>
        <td colspan="3"><span id="spryconfirm1">
          <label>
            <input name="Confirm Email2" type="text" class="test" id="Confirm Email2" size="35" />
          </label>
          <span class="confirmRequiredMsg">Required</span><span class="confirmInvalidMsg">The values don't match.</span></span></td>
      </tr>
      <tr>
        <td height="26" class="td">Photo(s)</td>
        <td colspan="3"><label>
          <input name="Photo" type="file" class="test" id="Photo" size="35" />
        </label></td>
      </tr>
      <tr>
        <td height="131" class="td">Additional Details</td>
        <td colspan="3"><label>
          <textarea name="Additional Details" cols="40" rows="6" class="test" id="Additional Details"></textarea>
        </label></td>
      </tr>
      </table>
      <p>
        <label>
          <input name="Submit" type="submit" class="test" id="Submit" value="Post" />
        </label>
      </p>
      <input type="hidden" name="MM_insert" value="individual" />
    </form>
    SERVER BEHAVIOR
    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;
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "individual")) {
      $insertSQL = sprintf("INSERT INTO donations (postingTitle, `size`, condition, length, color, city, `state`, email, photo) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)",
                           GetSQLValueString($_POST['Posting Title'], "text"),
                           GetSQLValueString($_POST['size'], "text"),
                           GetSQLValueString($_POST['Condition'], "text"),
                           GetSQLValueString($_POST['Length'], "text"),
                           GetSQLValueString($_POST['Color'], "text"),
                           GetSQLValueString($_POST['City'], "text"),
                           GetSQLValueString($_POST['State'], "text"),
                           GetSQLValueString($_POST['Email'], "text"),
                           GetSQLValueString($_POST['Photo'], "text"));
      mysql_select_db($database_bridesmaidsrack_db, $bridesmaidsrack_db);
      $Result1 = mysql_query($insertSQL, $bridesmaidsrack_db) or die(mysql_error());
      $insertGoTo = "donations.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      header(sprintf("Location: %s", $insertGoTo));
    DATABASE CONNECTION
    # FileName="Connection_php_mysql.htm"
    # Type="MYSQL"
    # HTTP="true"
    $hostname_bridesmaidsrack_db = "localhost";
    $database_bridesmaidsrack_db = "bridesmaidsrack";
    $username_bridesmaidsrack_db = "";
    $password_bridesmaidsrack_db = "";
    $bridesmaidsrack_db = mysql_pconnect($hostname_bridesmaidsrack_db, $username_bridesmaidsrack_db, $password_bridesmaidsrack_db) or trigger_error(mysql_error(),E_USER_ERROR);

    Hi David,
    I did as you recommended. For good measure, I even changed the case of the letters to make sure that they coincide with exactly what's in the database.  I still kept getting the same error message.  So I deleted the recordset and attempted to recreate it.  When I attempted to recreate the record set, I got the following error message: "RangeError: invalid array length".  My codes are listed below:
    Form:
    <form method="POST" enctype="multipart/form-data" name="individual" class="individual" id="individual">
      <table width="594" border="0" class="test">
      <tr></tr>
      <tr>
        <td width="166" class="td">Posting Title</td>
        <td colspan="3"><span id="sprytextfield1">
          <label>
            <input name="posting_title" type="text" class="test" id="posting_title" size="35" />
            </label>
          <span class="textfieldRequiredMsg">Required</span></span></td>
      </tr>
      <tr>
        <td class="td">Size(s)</td>
        <td colspan="3"><label>
          <select name="size" size="1" multiple="multiple" class="test" id="size">
      <option>0</option>
            <option>2</option>
            <option>4</option>
            <option>6</option>
            <option>8</option>
            <option>10</option>
            <option>12</option>
            <option>14</option>
            <option>16</option>
            <option>18</option>
            <option>20</option>
            <option>22</option>
            <option>24</option>
            <option>26</option>
            </select>
          <span class="Text">To select multiple sizes, hold ctrl and select each size.</span></label></td>
      </tr>
      <tr>
        <td class="td">Condition</td>
        <td colspan="3"><label>
          <select name="condition" class="test" id="condition">
    <option>New</option>
            <option>Used</option>
          </select>
        </label></td>
      </tr>
      <tr>
        <td class="td">Length</td>
        <td colspan="3"><label>
          <select name="length" class="test" id="length">
    <option>Long</option>
    <option>Short</option>
    <option>Mid-Length</option>
          </select>
        </label></td>
      </tr>
      <tr>
        <td class="td">Color(s)</td>
        <td colspan="3" class="td"><span id="sprytextfield5">
          <label>
            <input name="color" type="text" class="test" id="color" size="35" />
          </label>
          <span class="textfieldRequiredMsg">Required</span></span></td>
      </tr>
      <tr>
        <td class="td">City</td>
        <td class="td"><span id="sprytextfield4">
          <label>
            <input name="city" type="text" class="test" id="city" size="35" />
          </label>
          <span class="textfieldRequiredMsg">Required</span></span></td>
        <td class="td"> </td>
        <td class="td"> </td>
      </tr>
      <tr>
        <td class="td">State</td>
        <td colspan="3"><label>
          <select name="state" class="test" id="state">
            <option>AL</option>
            <option>AK</option>
            <option>AZ</option>
            <option>AR</option>
            <option>CA</option>
            <option>CO</option>
            <option>CT</option>
            <option>DE</option>
            <option>DC</option>
            <option>FL</option>
            <option>GA</option>
            <option>HI</option>
            <option>ID</option>
            <option>IL</option>
            <option>IN</option>
            <option>IA</option>
            <option>KS</option>
            <option>KY</option>
            <option>LA</option>
            <option>ME</option>
            <option>MD</option>
            <option>MA</option>
            <option>MI</option>
            <option>MN</option>
            <option>MS</option>
            <option>MO</option>
            <option>MT</option>
            <option>NE</option>
            <option>NV</option>
            <option>NH</option>
            <option>NJ</option>
            <option>NM</option>
            <option>NY</option>
            <option>NC</option>
            <option>ND</option>
            <option>OH</option>
            <option>OK</option>
            <option>OR</option>
            <option>PA</option>
            <option>RI</option>
            <option>SC</option>
            <option>SD</option>
            <option>TN</option>
            <option>TX</option>
            <option>UT</option>
            <option>VT</option>
            <option>VA</option>
            <option>WA</option>
            <option>WV</option>
            <option>WI</option>
            <option>WY</option>
          </select>
        </label></td>
      </tr>
      <tr>
        <td class="td">Email</td>
        <td colspan="3"><span id="sprytextfield3">
          <label>
            <input name="email" type="text" class="test" id="email" size="35" />
          </label>
          <span class="textfieldRequiredMsg">Required</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td>
      </tr>
      <tr>
        <td height="26" class="td">Confirm Email</td>
        <td colspan="3"><span id="spryconfirm1">
          <label>
            <input name="confirm_email2" type="text" class="test" id="confirm_email2" size="35" />
          </label>
          <span class="confirmRequiredMsg">Required</span><span class="confirmInvalidMsg">The values don't match.</span></span></td>
      </tr>
      <tr>
        <td height="26" class="td">Photo(s)</td>
        <td colspan="3"><label>
          <input name="Photo" type="file" class="test" id="Photo" size="35" />
        </label></td>
      </tr>
      <tr>
        <td height="131" class="td">Additional Details</td>
        <td colspan="3"><label>
          <textarea name="Additional Details" cols="40" rows="6" class="test" id="Additional Details"></textarea>
          <input name="hiddenField" type="hidden" id="hiddenField" value="Date" />
        </label></td>
      </tr>
      </table>
      <p>
        <label>
          <input name="Submit" type="submit" class="test" id="Submit" value="Post" />
        </label>
      </p>
    </form>
    Server Behavior
    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;
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "individual")) {
      $insertSQL = sprintf("INSERT INTO donations (posting_title, `size`, condition, length, color, city, `state`, email, photo) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)",
                           GetSQLValueString($_POST['posting_title'], "text"),
                           GetSQLValueString($_POST['size'], "text"),
                           GetSQLValueString($_POST['condition'], "text"),
                           GetSQLValueString($_POST['length'], "text"),
                           GetSQLValueString($_POST['color'], "text"),
                           GetSQLValueString($_POST['city'], "text"),
                           GetSQLValueString($_POST['state'], "text"),
                           GetSQLValueString($_POST['email'], "text"),
                           GetSQLValueString($_POST['Photo'], "text"));
      mysql_select_db($database_bridesmaidsrack_db, $bridesmaidsrack_db);
      $Result1 = mysql_query($insertSQL, $bridesmaidsrack_db) or die(mysql_error());
      $insertGoTo = "donations.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      header(sprintf("Location: %s", $insertGoTo));

  • Recordset error

    Whenever I try to create a recordset I get an error, i
    reinstalled still
    there:
    "While executing applyServerBehaivor in Recordset.htm, a
    Javaqscript error
    occurred."
    Any ideas ? I cant work !!!
    Aleks

    Aleks wrote:
    > Whenever I try to create a recordset I get an error, i
    reinstalled still
    > there:
    >
    > "While executing applyServerBehaivor in Recordset.htm, a
    Javaqscript error
    > occurred."
    http://www.adobe.com/go/tn_19105
    David Powers, Adobe Community Expert
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • Recordset errors

         Hi new poster here. Quick history of the issues I'm having. I was running CF 8 64bit with Vista and had the MS Access driver issue. SO I downloaded CF 9 32 bit version and can now define my datasource for an Access database. No problems there now so that's good. Now when I go and define a recordset for a select query, I add several records to the Select statement and for some reason a particular record I add, CF always puts this record name in parenthesis. i.e. "Size" My database did not have the parenthesis included, but CF adds them just on this record name. With CF 8 it didn't seem to be a problem, but now with version 9 it throws up an error message: adojni.ComException: invalid use of '.','!', or '()'. in a query expression tblSwimwear."Size" in Microsoft JET database engine code 3092
         I know this is a lot to digest, but I'm very confused as to what's going on here. Again CF 8 had no problem with the " " around Size. I can even go and remove the parenthesis around Size before I test the select query, and still get the error. If I leave out the Size record, I get no errors.
         I will add this so I make sure ';m covering all the bases, but when I defined my datasource, I had to use Microsoft Access Unicode as my driver. Don't know if that would make a difference, but still letting anyone who may can help know. Thanks in advance!

    teedoffnewbie wrote:
    I am using Dreamweaver cs3 to build CFM templates
    . I use the recordset wizard to build my query.
    Again when I did the same thing using CF 8, CF 8 also "put" the quotation marks around the word Size(my DB record name) as well, but it was never a problem. In CF 8 I could either leave the quotes around the word, or if I wanted to, take them out. Either way worked with CF 8. CF 9 however doesn't let me do either one. It automatically, for some reason puts " " around Size and gives the error. When I remove the quote marks I still get the same error.
    Again sorry if I am not clear enough, I just started learning CF about 2 months ago.
    In response to the next poster, I cannot post my code since it wont let me finish defining the query.
    Using dreamweaver and using the developer edition of the CF server running locally on my machine. also can upload the cf templates to my schools web server running CF as well.
    OK, so first advice is if you're trying to learn CF: stop using all the wizards and what not, and code your templates by hand.  You will never get anywhere if you rely on the code that DW generates, and if it's anything like it used to be last time I used it, the code it generates is rubbish anyhow, so it's a very poor CF tutor.
    Secondly, if you say you can't post your code because it "won't let you finish defining the query" (in the DW query wizard, yes?) then that's a DW problem, not a CF problem.  Anyhow, there's nothing to stop you NOT using that wizard and just coding the SQL by hand (which you should be doing if you're a learner anyhow, IMO).
    Adam

  • Php/mySQL error after updating

    I updated my Mac last week from Leopard 10.5.8 to Snow Leopard 10.6.2
    After the update I am now unable to run local connections to the mySQL server I have running on my Mac. I now get this type of error:
    +Warning: mysql_pconnect() [function.mysql-pconnect]: [2002] No such file or directory (trying to connect via unix:///tmp/mysql.sock) in /Users/Luke/Sites/tbec/Connections/tbec.php on line 9+
    +Warning: mysql_pconnect() [function.mysql-pconnect]: No such file or directory in /Users/Luke/Sites/tbec/Connections/tbec.php on line 9+
    +Fatal error: No such file or directory in /Users/Luke/Sites/tbec/Connections/tbec.php on line 9+
    I have checked to see the php.ini file is setup in the etc folder, and it is.
    Has anyone suffered the same issue as me? If so what is the cure?

    Try perusing and posting to the Unix forum under OS X Technologies where those gurus congregate.

  • PHP Header Error on HTML Page

    I'm trying to put some php I made into an html file but I'm running into a snag. My PHP script is a login in script and when I successfully login I get the folowing error:
    Warning: Cannot modify header information - headers already sent by (output started at /home/tyharox1/public_html/login.php:64) in/home/tyharox1/public_html/login.php on line 83
    Below is the code for the html file with with the php already writen in. Can anyone help me resolve this issue?
    <?php
    session_start();
    include ('mysql.php');
    ?>
    <!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>
    <!--[if lt IE 9]>
    <script src="html5shiv.js"></script>
    <![endif]-->
    <link href='http://fonts.googleapis.com/css?family=Coda' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" type="text/css" href="mainmenu.css"/>
    <link rel="stylesheet" type="text/css" href="submenu.css"/>
    <link rel="stylesheet" type="text/css" href="mainpage.css"/>
    <link rel="stylesheet" type="text/css" href="slideshow.css"/>
    <link rel="stylesheet" type="text/css" href="ribons.css"/>
    <script type="text/javascript" src="js/jquery-1.2.6.js"></script>
    <script type="text/javascript" src="js/startstop-slider.js"></script>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!-- TemplateBeginEditable name="doctitle" -->
    <title>Home</title>
    <!-- TemplateEndEditable -->
    <!-- TemplateBeginEditable name="head" -->
    <!-- TemplateEndEditable -->
    <style type="text/css">
    body {
              background-color: #222;
    </style>
    </head>
    <body>
    <div>
    <img name="Logo" src="images/84087.jpg" width="100%" height="50px" alt="" />
    </div>
    <div id='mainmenu'>
              <ul>
                          <li class='active '><a href='Templates/index.html'><span>AITP</span></a></li>
                           <li><a href='#'><span>test</span></a></li>
                           <li><a href='#'><span>test</span></a></li>
                           <li><a href='#'><span>test</span></a></li>
                           <li><a href='#'><span>test</span></a></li>
              </ul>
        </div>
    </div>
    <div id="submenu">
                        <ul>
                                     <li class='active'><a href='Templates/index.html'><span>Home</span></a></li>
                                     <li><a href='#'><span>About Us</span></a></li>
                                     <li><a href='#'><span>Calendar</span></a></li>
                                     <li><a href='#'><span>Contact</span></a></li>
                                     <li><a href='#'><span>Members</span></a></li>
                        </ul>
              </div>
    <div>
    </div>
    <div class="ribbon">
        <h3>Memeber Login</h3>
        <section id="filler">
              Please Login
        <?php
    session_start();
    include ('mysql.php');
    if (isset ($_POST['submit'])) {
                        $username = mysql_escape_string($_POST['username']);
                        $password = mysql_escape_string(sha1($_POST['password']));
                        if (!empty ($username) && !empty ($password)) {
                                            $sql = mysql_query ("SELECT * FROM users
                                                                                              WHERE username='".$username."' AND
                                                                                              user_password='".$password."' LIMIT 1");
                                            if (mysql_num_rows ($sql) > 0) {
                                                      $_SESSION['loggedin'] = true;
                                                      $_SESSION['username'] = $username;
                                                      header("Refresh: 2; url=index.html");
                                                                       echo '<span style="color: #063; font-weight: bold;">Login Successful! You are now being redirected, Please Wait...</span>';
                                            }else{
                                                      echo 'Your username and/or password is incorrect!';
                        }else{
                                  echo 'You must enter a suername and password!';
    }else{
    echo '<form action="login.php" method="post">
    Username: <input type="text" name="username" /><br />
    Password: <input type="password" name="password" /><br />
    <input type="submit" name="submit" value="login" />
    </form>';
    ?>
        <section id="date">
                        <span id="publisher">Publisher:</span> Jane Doe <span id="publisher">Date:</span> Oct. 10, 2012
        </section>
        </section>
    </div>
    </div>
    <div id="footer">
    </div>
    </body>
    </html>

    You cannot use the PHP header function after anything has sent to the browser. Anything. You can have 100 lines of PHP before header() as long as the script doesn't send anything to the browser.
    So your options are to revise your code accordingly or use a javascript alternative, as in this example, where a little embedded php defines the actual url, but javascript is used to process it:
    <script type="text/javascript">
    window.location = "<?=$url?>";
    </script>

  • Php form error?

    Hi. I've got php form from one of the templates but it doesn't work. Can anyone see an error?
    The code:
    <div id="content_item">
              <h1>Contact Us</h1>
              <p>Say hello, using this contact form.</p>
              <?php
                // Set-up these 3 parameters
                // 1. Enter the email address you would like the enquiry sent to
                // 2. Enter the subject of the email you will receive, when someone contacts you
                // 3. Enter the text that you would like the user to see once they submit the contact form
                $to = [email protected];
                $subject = Enquiry from the website;
                $contact_submitted = Your message has been sent.;
                // Do not amend anything below here, unless you know PHP
                function email_is_valid($email) {
                  return preg_match('/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i',$email);
                if (!email_is_valid($to)) {
                  echo '<p style="color: red;">You must set-up a valid (to) email address before this contact page will work.</p>';
                if (isset($_POST['contact_submitted'])) {
                  $return = "\r";
                  $youremail = trim(htmlspecialchars($_POST['your_email']));
                  $yourname = stripslashes(strip_tags($_POST['your_name']));
                  $yourmessage = stripslashes(strip_tags($_POST['your_message']));
                  $contact_name = "Name: ".$yourname;
                  $message_text = "Message: ".$yourmessage;
                  $user_answer = trim(htmlspecialchars($_POST['user_answer']));
                  $answer = trim(htmlspecialchars($_POST['answer']));
                  $message = $contact_name . $return . $message_text;
                  $headers = "From: ".$youremail;
                  if (email_is_valid($youremail) && !eregi("\r",$youremail) && !eregi("\n",$youremail) && $yourname != "" && $yourmessage != "" && substr(md5($user_answer),5,10) === $answer) {
                    mail($to,$subject,$message,$headers);
                    $yourname = '';
                    $youremail = '';
                    $yourmessage = '';
                    echo '<p style="color: blue;">'.$contact_submitted.'</p>';
                  else echo '<p style="color: red;">Please enter your name, a valid email address, your message and the answer to the simple maths question before sending your message.</p>';
                $number_1 = rand(1, 9);
                $number_2 = rand(1, 9);
                $answer = substr(md5($number_1+$number_2),5,10);
              ?>
              <form id="contact" action="contact.php" method="post">
                <div class="form_settings">
                  <p><span>Name</span><input class="contact" type="text" name="your_name" value="<?php echo $yourname; ?>" /></p>
                  <p><span>Email Address</span><input class="contact" type="text" name="your_email" value="<?php echo $youremail; ?>" /></p>
                  <p><span>Message</span><textarea class="contact textarea" rows="5" cols="50" name="your_message"><?php echo $yourmessage; ?></textarea></p>
                  <p style="line-height: 1.7em;">To help prevent spam, please enter the answer to this question:</p>
                  <p><span><?php echo $number_1; ?> + <?php echo $number_2; ?> = ?</span><input type="text" name="user_answer" /><input type="hidden" name="answer" value="<?php echo $answer; ?>" /></p>
                  <p style="padding-top: 15px"><span> </span><input class="submit" type="submit" name="contact_submitted" value="send" /></p>
                </div>
              </form>
            </div>

    The only error I see is your text strings which are assigned to the php variables should be enclosed in "  " like below: (best not to post real email addresses as it attracts spam)
    $to = "[email protected]";
                $subject = "Enquiry from the website";
                $contact_submitted = "Your message has been sent.";
    Plus change the $return variable to a line break (as below) otherwise the information will come through in one continuous line.
    $return = "\n\n";

  • PHP/MySQL error since upgrading to Snow Leopard

    When I upgraded to Snow Leopard from Leopard I am getting errors on my webserver:
    *Warning: mysql_connect() http://function.mysql-connect: OK packet 6 bytes shorter than expected in /Library/WebServer/mysql_connect.php on line 8*
    *Warning: mysql_connect() http://function.mysql-connect: mysqlnd cannot connect to MySQL 4.1+ using old authentication in /Library/WebServer/mysql_connect.php on line 8*
    The MySQL server is hosted remotely, and the php files are running locally.
    Any ideas?
    Thanks in advance.

    Got mine working:
    I fixed the bug per http://bugs.php.net/bug.php?id=49267
    and
    I complied php-5.3.1RC1 with
    ./configure '--prefix=/usr' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--disable-dependency-tracking' '--sysconfdir=/private/etc' '--with-apxs2=/usr/sbin/apxs' '--enable-cli' '--with-config-file-path=/etc' '--with-libxml-dir=/usr' '--with-openssl=/usr' '--with-kerberos=/usr' '--with-zlib=/usr' '--enable-bcmath' '--with-bz2=/usr' '--enable-calendar' '--with-curl=/usr' '--enable-exif' '--enable-ftp' '--with-ldap=/usr' '--with-ldap-sasl=/usr' '--enable-mbstring' '--enable-mbregex' '--with-mysql=/usr/local/mysql' '--with-mysql-sock=/var/mysql' '--with-mysqli=/usr/local/mysql/bin/mysql_config' '--with-iodbc=/usr' '--enable-shmop' '--with-snmp=/usr' '--enable-soap' '--enable-sockets' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--with-xmlrpc' '--with-iconv-dir=/usr' '--with-xsl=/usr'

  • Create price range search function in php recordset

    Hi,
    On a continuation from a previous thread, I am finding that the expertise of the web designers on these forums is proving much more educational and beneficial than the vast numbers of books I have bought to setup a website for my property company. (Without sounding too sycophantic!).
    I have managed to create a working website where the properties in my database and their related images are pulled into a recordset on the live webpage and everything is working perfectly. I do however want to add some simple filters on the search page to narrow down the results from the database.
    I am finding that given one push or piece of coding I can work out the rest myself. Therefore, all I would like to do is create a price range drop down, where clients can select properties from the database in one of 3 categories: under £1m, £1m-£2m, and over £2m.
    As I understand it, I need two pages to do this, one html form page where the clients will input their search criteria with coding similar to:
    <form action="search_results.php" method="post" name="search" id="search" >
    Price Range:
    <select name="prop_price" id="select8">
    <option value="<1000000">             >£1,000,000                   </option>
    <option value="1000000-2000000">    £1,000,000 - £2,000,000</option>
    <option value=">2000000">             >£2,000,000                   </option>
    </select>
    <input name="search" type="submit" id="search" value="search">
    </form>
    (apologies for my messy coding - I am still new and not sure if certain fields arent required yet!).
    Then, I would need to create the search_results.php page which would give the results of properties in the database depending on the price range submitted. I have tried various different methods put online through the forums, but cannot seem to get anything post 2006, nor anything that has actually worked. I am using Dreamweaver CS5 and MySQL for my db.
    How do I incorporate the above search criteria into a dynamic php doc? The only way I have managed to get something working is to create a new page for each of the price variables -something which is incredibly inefficient, and hardly something that can be developed easily going forward.
    The php code I currently have that is retrieving all the properties from my database is as follows (connection name is test, recordset name is getDetails):
    <?php require_once('Connections/test.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      $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_getDetails = 20; 
    $pageNum_getDetails = 0; 
    if (isset($_GET['pageNum_getDetails'])) { 
       $pageNum_getDetails = $_GET['pageNum_getDetails']; 
    $startRow_getDetails = $pageNum_getDetails * $maxRows_getDetails;
    mysql_select_db($database_test, $test);
    $query_getDetails = "SELECT id, prop_name, prop_price, country, post_code, short_desc, image FROM images order by prop_price DESC";
    $query_limit_getDetails = sprintf("%s LIMIT %d, %d", $query_getDetails, $startRow_getDetails, $maxRows_getDetails); 
    $getDetails = mysql_query($query_limit_getDetails, $test) or die(mysql_error());
    $row_getDetails = mysql_fetch_assoc($getDetails);
    if (isset($_GET['totalRows_getDetails'])) { 
       $totalRows_getDetails = $_GET['totalRows_getDetails']; 
    } else { 
       $all_getDetails = mysql_query($query_getDetails); 
       $totalRows_getDetails = mysql_num_rows($all_getDetails); 
    $totalPages_getDetails = ceil($totalRows_getDetails/$maxRows_getDetails)-1;
    ?>
    <table width="990" border="0" align="center" cellpadding="0" cellspacing="0"> 
         <tr>   
         </tr> 
         <?php do { ?> 
           <tr>   
             <td><img src="show_image.php?id=<?php echo $row_getDetails['id']; ?>"></td> 
             <td><?php echo $row_getDetails['prop_name']; ?></td>
             <td><?php echo $row_getDetails['prop_price']; ?></td>
             <td><?php echo $row_getDetails['short_desc']; ?></td>
             </tr> 
             <?php } while ($row_getDetails = mysql_fetch_assoc($getDetails)); ?> 
             </table> 
    <?php
    mysql_free_result($getDetails);
    ?>
    Essentially, I need to incorporate the WHERE function into my sql query, but how do I do this so that it is dependent on the clients submission on the search page.......?
    Sorry if this is incredibly easy, but I am at a complete loss now and cant try any more techniques from the various forums out there! I even downloaded the entire Zen cart framework just to see if I could find something in the vast numbers of php pages that came with it!
    Hope someone can help -
    Thanks
    Jack

    Hi Gunter,
    Thanks for your quick response. I thought I had it but not quite yet. I uploaded these pages into live browser but am only getting the following on the search results page:
    This is the case for all three parameters. As I have not yet uploaded all the properties into mysql, there are only 2 live ones in there, one is prop_price at 600,000 (int) and the other prop_price 2300000 (int). For the query to work, should this field in mysql be a different format?
    For your reference, the new show_results.php code is:
    <?php require_once('Connections/test.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      $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_getDetails = 20;
    $pageNum_getDetails = 0;
    if (isset($_GET['pageNum_getDetails'])) {
       $pageNum_getDetails = $_GET['pageNum_getDetails'];
    $startRow_getDetails = $pageNum_getDetails * $maxRows_getDetails;
    if(isset($_POST['prop_price']))
    switch($_POST['prop_price'])
      case ("a"):
    $price_whereclause = ' WHERE prop_price < 1000000 ';
      break;
      case ("b"):
    $price_whereclause  = ' WHERE prop_price BETWEEN 100000 AND 200000 ';
      break;
      case ("c"):
    $price_whereclause  = ' WHERE prop_price < 2000000 ';
      break;
    else {
    $price_whereclause  = '';
    mysql_select_db($database_test, $test);
    $query_getDetails = "SELECT id, prop_name, prop_price, country, post_code, short_desc, image FROM images ".$price_whereclause." order by prop_price DESC";
    $query_limit_getDetails = sprintf("%s LIMIT %d, %d", $query_getDetails, $startRow_getDetails, $maxRows_getDetails);
    $getDetails = mysql_query($query_limit_getDetails, $test) or die(mysql_error());
    $row_getDetails = mysql_fetch_assoc($getDetails);
    if (isset($_GET['totalRows_getDetails'])) {
       $totalRows_getDetails = $_GET['totalRows_getDetails'];
    } else {
       $all_getDetails = mysql_query($query_getDetails);
       $totalRows_getDetails = mysql_num_rows($all_getDetails);
    $totalPages_getDetails = ceil($totalRows_getDetails/$maxRows_getDetails)-1;
    ?>
    <table width="990" border="0" align="center" cellpadding="0" cellspacing="0">
         <tr>  
         </tr>
         <?php do { ?>
           <tr>  
             <td><img src="show_image.php?id=<?php echo $row_getDetails['id']; ?>"></td>
             <td><?php echo $row_getDetails['prop_name']; ?></td>
             <td><?php echo $row_getDetails['prop_price']; ?></td>
             <td><?php echo $row_getDetails['short_desc']; ?></td>
             </tr>
             <?php } while ($row_getDetails = mysql_fetch_assoc($getDetails)); ?>
             </table>
    <?php
    mysql_free_result($getDetails);
    ?>
    I know its very cheeky, but assuming you can help with fixing this, where in the coding would I insert a "No properties returned. Please try another query" response should the db not have anything in the set parameters (instead of the symbol currently being displayed).
    Again thanks so much for all your help.
    Jack

Maybe you are looking for