Jump to content

gristoi

Members
  • Posts

    840
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by gristoi

  1. You just need to remove the members_id from the insert query.

    Example:

      Insert into members ( username, firstname, lastname, password, register_date, ip) VALUES ( username, firstname, lastname, password, register_date, ip)

     

    The members_id field will auto increment upon insertion for you

  2. ok, from your table structure this should give you what you need:

    For example $_GET['book_id] = $id

    SELECT
    b.book_title AS Title,
    b.book_price AS Price,
    c.customer_name, 
    p.purchase_date
    FROM purchases p 
    LEFT JOIN customers c ON (p.customer_id = c.customer_id) 
    LEFT JOIN books b ON (p.book_id = b.book_id)
    WHERE p.book_id = $id
    

     

    If you only want to get the most recent purchase of the book then try adding this to the end of the query:

    ORDER BY p.purchase_date desc
    LIMIT 1

     

    hope this helps

  3. by the look of it that is just a typo in the contact_config.php, the  'City where jobsite is located' part is actually pulling the comments:

    ."<br>City where jobsite is located: ".$_POST['posText']

    should be:

    ."<br>Comments: ".$_POST['posText']

    .

     

    To save going over old code i think what you want is this:

    $message = "Site visitor information:
    <br><br> Name: ".$_POST['posName']
    ."<br>E-mail: ".$_POST['posEmail']
    ."<br>Phone: ".$_POST['posRegard']
    ."<br>Location Details:
    <br>City: ".$_POST['posCity']
    ."<br>State: ".$_POST['posState']
    ."<br>Zip Code: ".$_POST['posZip']
    ."<br>User Comments: ".$_POST['posText'];
    

     

    that should get you on your way  :)

  4. Ok,

    So your going to want to change the section of the form from:

    <tr>
    <td><label for="posCountry">Country:</label></td><td><input  class="input_contact" type="text" size="25" name="posCountry" id="posCountry" value=""/>
           </td>
           </tr>
    

     

    to:

    <tr>
    <td><label for="posCity">City:</label></td><td><input  class="input_contact" type="text" size="25" name="posCity" id="posCity" value=""/>
           </td>
           </tr>
    <tr>
    <td><label for="posState">State:</label></td><td><input  class="input_contact" type="text" size="25" name="posState" id="posState" value=""/>
           </td>
           </tr>
    <tr>
    <td><label for="posZip">Zip Code:</label></td><td><input  class="input_contact" type="text" size="25" name="posZip" id="posZip" value=""/>
           </td>
    
           </tr>

     

     

    and in your config_contacts.php change:

    ."<br>Country: ".$_POST['posCountry']

     

    to:

    ."<br>City: ".$_POST['posCity']
           ."<br>State: ".$_POST['posState']   etc .........................

     

     

    hope that helps

     

     

     

     

  5. Hi nevell,

     

    One thing straight away that is going to cause you an issue are your header declarations in your contacts.php. if you echo out your headers you have an extra " escaping the string.

     

    Change:

     

     $headers .= "From: \"".$_POST['posName'];

     

    to:

     

     $headers .= "From: ".$_POST['posName'];

     

    and

     $send = mail("$mailto","$subject","$message","$headers");

     

    to:

     $send = mail($mailto,$subject,$message,$headers); 

     

    hope this points you in the right direction

     

     

     

  6. Hi, you would be better if you declared the fields to insert into:

     

    mysql_query("INSERT INTO categories (`fileda`, `fieldb`) VALUES ('$cName', '$cDesc')") or die(mysql_error());

     

    where field a and field b are the names of the two fields that you wish to insert the values into.

     

    The error message you are getting is basically telling you that you have an extra " in your query. This is more than likey being passed into the query by either $cName or $cDesc. echo out these variables and make sure $cName = bob and not  "bob"

×
×
  • 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.