Jump to content

MsKazza

Members
  • Posts

    92
  • Joined

  • Last visited

Posts posted by MsKazza

  1. Hi all,

     

    I want to be able to have one file (configuration file i guess) where i set the phone number, address, staff names and positions, etc.  and then have them display at different places on various pages.  I thought they were inc files, but all i can find is the likes of headers and footers.  Any help much appreciated.  I just don't know what it's called, if someone can point me in the right direction, thanks.

     

    MsKazza

  2. your MySQL server version -- absolutely required!  - 5.0

    the raw MySQL statement in question [in a CODE block, and without any PHP variables]  -  none so far

    any errors that MySQL returns to the client [from mysql_error()]  -  none so far

    the table structure & column indexes of the relevant tables [via SHOW CREATE TABLE is preferred]

    first_name

    sur_name

    house_no

    street

    town

    brother_sister_friend1

    friend_sibling1

    and

    brother_sister_friend2

    friend_sibling2

    she_he

    his_her

    him_her

    from_title from_name

     

     

    the EXPLAIN output for your query, if applicable

    a clear and concise description of what you want this statement to achieve  -  as above

    a description of what it's currently doing that's not to your liking

    a brief listing of the types of things you've attempted so far

  3. Hi there,

     

    I have been searching on internet but can't seem to find this.  I have a client that wants the form field 'he/she' to appear only once on the form, however they want the value selected to appear in various mysql columns in the same record, how can i do this.  Any help would be much appreciated.

     

    Thanks a million,

     

    MsKazza

  4.     // Enter details into database

        $query = "INSERT INTO coupons

                      (coupon_code, fname, sname, email, phone)

                  VALUES

                      ('{$coupon}','{$fname}','{$sname}','{$email}','{$phone}')";

     

     

    i count five on each coupon, fname, sname, email and phone

  5. oh and i get this when a duplicate key instead of saying the coupon you have entered is already been used :

     

     

    Warning: mysql_num_rows() expects parameter 1 to be resource, string given in C:\xampp\htdocs\couponsite\process.php on line 30

    Error running query: INSERT INTO coupons (coupon_code, fname, sname, email, phone) VALUES ('d11223','Jessica','Liddy','jess@gmail.com','')

     

    Error: Duplicate entry 'd11223' for key 'coupon_code'

     

     

    Kustom what do you mean remove the complex syntax?

  6. Thank you all so much for your responses.  I made the changes that you suggested mjdamato

     

    When i run your revision i get the error :

    Warning: mysql_num_rows() expects parameter 1 to be resource, string given in C:\xampp\htdocs\couponsite\process.php on line 30

     

    which is : elseif (mysql_num_rows($query) > 0)

     

    but it is entering info in database and checking winning coupon

     

  7. Hi,

     

    I am doing a coupon app for my sister.  First it's supposed to check for existance of coupon if its been used then it says sorry been used, if not been used it inserts it into database.

     

    after that it checks if its the winning coupon or not.

     

    Now the second bit works fine (i think).  However the first part does check for the coupon number but won't insert into database, i know its my syntax but i have been looking so long i can see any more!!  Obviously if the coupon has been used then the second part of the code doesn't need to run.

     

    If anyone can offer any suggestions or corrections would be much appreciated.

     

    thanks,

     

    MsKazza

     

     

    <?php
    
    //Get Values from Coupon.php Form
    $fname = $_POST['fname'];
    $sname = $_POST['sname'];
    $email = $_POST['email'];
    $phone = $_POST['phone'];
    $coupon = $_POST['coupon_code'];
    
    
    // Database connect
    $con = mysql_connect("localhost","root","");
    if (!$con)
      {
      die('Could not connect: ' . mysql_error());
      }
    
    mysql_select_db("coupons", $con);
    
    
    // Check if unique code
    $query = mysql_query("SELECT * FROM coupons WHERE coupon_code = '". $coupon ."'");
    
    
    
    if (mysql_num_rows($query) > 0)
    
    {
    
         echo 'This Coupon code has already been used. Please try again.';
    end
    else {
    
    
    // Enter details into database
    
    $sql="INSERT INTO coupons (coupon_code, fname, sname, email, phone)
    VALUES
    ('$_POST[coupon_code]','$_POST[fname]','$_POST[sname]','$_POST[email]','$_POST[phone]')";
    }
    
    //if (!mysql_query($sql,$con))
    //  {
    //  die('Error: ' . mysql_error());
    //  }
    //echo "1 record added";
    
    mysql_close($con)
    ?>
    
    <?php
    // Check if winning code or not
    if ( $coupon == D11223 ) {
    echo 'Thank you  '. $fname . ' you entered coupon code number: ' . $coupon . '.<br />';
    echo 'You are a Winner!!  Please click <a href="here.php"> here</a> to claim your prize';
    } else {
    echo 'Sorry  '. $fname . ' you entered coupon code number: ' . $coupon . '.<br />';
    echo "Sorry you have not won this time, please try again.";
    }
    
    ?>
    
    

  8. thank you but i don't see how that applies to what i'm asking, i have three drop down boxes on my page, product, weight and quantity.  I want to use the dropdowns to filter the recordset, so choosing a specific product will filter down to only the weight and quantities possible for that product, then when they choose weight and quantity it will display the price for that specific product at the end of the page.

     

    Please help urgent.  I have to get this done today, one way or another.

    Thanks

    MsKazza

  9. Hi there,

    I'm coding a products page (pls see : http://agraphics.ie/products.php?recordID=4) so far i have it picking up the products from the database, filtering categories via the menu, and then product weight and quantity on the page.  My problem is that i need to display the price at the bottom and also have it add or take away 49€ depending on the radio button.  Any help much appreciated as i'm running out of time.  I tried experts-exchange but so far nothing from them.

     

    Thanks in advance for any help.

    MsKazza

    :)

  10. I´m running it on my local machine whilst it´s in development using Xampp, i´m not sure how to turn on all error reporting.

     

    At the moment i have the code as such:

    <td><? if ($vTakeout=='y') {?>

    <img src="takeoutyes.jpg">

    <? } elseif ($vTakeout=='n') { ?>

    <img src="takeoutno.jpg">

    <? } ?> </td>

     

    but all that happens is i get a white space on the page, i have it in text format below, so it´s picking up the db okay.  I´m using Dreamweaver and Xampp

  11. I am creating a site for a restaurant directory, on the listing form users can select from different options, e.g. takeout, parking, tv, disabled, etc via checkboxes. How can i make it on the listings page so that if the mysql field = y it displays the appropriate image rather than text?

    e.g. if takeout=y

    then display takeout.gif

    if takeout=n

    then no image to display.

    I want all the images to appear in a line along the end of the listing so site visitors can see the features offered by the restaurants.

     

    if field = no, i don´t want it to display an image at all, how can i do that without leaving a big space. In other words i only want it to display pics for fields that have a Y in them

     

    i have just tried it using the following:

    <td><? if (vTakeout='y')?>

    <img src="takeoutyes.jpg">

    <? else if (vTakeout='n')?>

    <img src="takeoutno.jpg">

    <? end if?> </td>

     

    and get this error:

    Parse error: syntax error, unexpected '=' in C:\xampp\htdocs\Diningout\site... on line 223

     

    i have also tried the following, but nothing happens.

    <td><? if (vTakeout=='y') {?>

    <img src="takeoutyes.jpg">

    <? } elseif (vTakeout=='n') { ?>

    <img src="takeoutno.jpg">

    <? } ?> </td>

     

    i know that the page is reading the fields correctly as i´ve put in the field in text format to show y or n

     

    thanks in advance for your help :)

     

    MsKazza

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.