huzi8t9's Profile User Rating: -----

Reputation: 23 Tradesman
Author w/DIC++
Active Posts:
330 (0.13 per day)
11-July 07
Profile Views:
Last Active:
User is offline May 16 2014 04:51 AM

Previous Fields

OS Preference:
Favorite Browser:
Favorite Processor:
Favorite Gaming Platform:
Your Car:
Dream Kudos:

Latest Visitors

Icon   huzi8t9 Enjoying LEGO Batman way too much for the 360....

Posts I've Made

  1. In Topic: [SOLVED] MySQL Syntax - unable to correctly populate

    Posted 8 Apr 2014

    View PostArtificialSoldier, on 08 April 2014 - 06:52 PM, said:

    You need parentheses in the WHERE clause. If any of those conditions surrounded by OR match then the record will be returned regardless of whether or not the AND conditions match. Use parentheses to tell it exactly what you mean.

    Nailed it - thank you! The query ended up being SELECT * FROM posts, users WHERE (users.user_id=posts.post_id AND posts.post_replyto='0' AND posts.post_removed='0' AND posts.post_privacy='World') OR (posts.post_replyto='0' AND posts.post_removed='0' AND posts.post_user='2' AND users.user_id=posts.post_user) OR (posts.post_replyto='0' AND posts.post_removed='0' AND posts.post_user='3' AND users.user_id=posts.post_user) ORDER BY posts.post_date DESC;. The parentheses did the trick.

    Thank you again.

  2. In Topic: Not able to pass $_Session variables

    Posted 28 Jan 2014

       // get the product id
       $DVDID = isset($_GET['DVDID']) ? $_GET['DVDID'] : "NOT_SET";
       $name = isset($_GET['NameOfTheDVD']) ? $_GET['NameOfTheDVD'] : "NOT_SET";
       $Quantity = isset($_GET['Quantity']) ? $_GET['Quantity'] : "NOT_SET";
       require "connect.php";
       $query = "SELECT `DVDID`, `NameOfTheDVD`, `Quantity` FROM `DVD`";
       $stmt = $dbhandle->prepare($query);
        * check if the 'cart' session array was created
        * if it is NOT, create the 'cart' session array
     . */
         $_SESSION['cart'] = array();
        array_push($_SESSION['cart'][], $DVDID);
        // !!- The above line WAS aray_push($_SESSION['cart'][] = $DVDID); - it should be coma separated. In the first parameter, you're telling the function WHICH array you're pushing to, the SECOND parameter is the value you want adding to the array(the FIRST parameter).
        // redirect to product list and tell the user it was added to cart
        header('Location: shop.php?$action=add&DVDID=' . $DVDID . '&NameOfTheDVD=' . $name);

    Try setting the values where you're initially assigning them to a variable. It appears they're coming from $_GET on your first section of code. I've changed some of it to work, see the comments.

    Secondly, I see you're querying the database but doing nothing with the result?

    Hope this helps


    edit changed a typo
  3. In Topic: Not able to pass $_Session variables

    Posted 28 Jan 2014

    View Postmfredy92, on 28 January 2014 - 08:14 PM, said:

    May I confirm are you talking about in the syntax in the address>

    Yes, when you're using header("location: ...");, are the values being filled out by the variables in the next page, on the address bar? If they are, but aren't showing up later on, make sure they're not being nulled or overwritten.

    Try using print_r($_GET); exit;, see what's being passed.

  4. In Topic: Not able to pass $_Session variables

    Posted 28 Jan 2014

    That syntax looks OK; in the address bar, are the variables being set as expected?

  5. In Topic: Not able to pass $_Session variables

    Posted 28 Jan 2014

    View Postmfredy92, on 28 January 2014 - 07:48 PM, said:

    I don't know what part of post 7 makes it interesting because Andrew asked me to remove the $ sign before action, which I did. According to you, DVDID is not defined, but I have defined it in the shop page and the AddToCart.

    Yes, I did follow your instructions which was to use the function session_start() on all the scripts which I did. I think it is very important for you to know that while I have been stuck ion this problem for 2 weeks, I have been making progress as I was able to track the error and today thanks to your expertise in PHP, I have realised there is a problem in the URL.

    Now with the URL, can you be sepcific on what I am doign wrong. Is it because I am not using the variables correctly or what?

    Thank you for you advice.

    When attempting to echo variables in a string, you either have to escape the string or use correct syntax, such as

    $mystring = "Welcome, ". $_SESSION['user_name'] ."!";
    $mystring = "Welcome, {$_SESSION['user_name']}!";

    When your passing parameters through the URL, you shouldn't use, or be aware that you are using, special characters, such as the dollar sign.

    When you're redirecting through the header, ensure you're setting the correct variables, ensure they're typed as you expected.

    header("Location: page.php?$action=MY_ACTION");
    $action = $_GET['$action'];

    As I said previously, when using strings, if you mix up the syntax, you may end up with an error, such as:

    $action = $_GET["$action"];

    Since the PHP interpreter is now looking for a variable named $action, but it's not defined.

    I hope this makes some sense and you can use it in the future, and hopefully, to help you with the current problem.



My Information

Member Title:
D.I.C Regular
25 years old
August 30, 1989
Nottinghamshire, England
Programming, Rock Climbing, Programming.
Full Name:
Mark Hughes
Years Programming:
Programming Languages:
HTML, JavaScript, jQuery, Visual Basic, C++, PHP, ASP, ActionScript 2/3

Contact Information

AIM  Glitcher 04
Website URL:
Website URL
Yahoo  gOoDnPlEnTy83
Skype  huzi8t9



Page 1 of 1
  1. Photo

    jesicalbaby Icon

    16 Sep 2013 - 14:34
    My name is Miss jesical,
    i saw your profile today
    and,i fill more interest to contact you ,
    i will like you to please send me
    an email via (
    for me to send you my picture
  2. Photo

    ahmed12345 Icon

    19 Feb 2012 - 12:09
    i am having problem in under standing with this assignment, can any one out there help me to better under stand

    1. Demonstrate knowledge of abstract classes and interfaces,
    2. Show how to handle exceptions.


    This is an assignment about Assignments and Grades. Some Assignments in this class are Gradab...
Page 1 of 1