Jump to content

floridaflatlander

Members
  • Posts

    671
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by floridaflatlander

  1. Thanks Jessica, that works great, but I don't know why.

     

    I would think it would be it would be OR because the category is either a parent or has a parent not both. What am I looking at wrong?

     

    Thanks

     

    Added

    Thanks again Jessica, I see it now.

  2. I can't figure this out the first sql statement with "=" works fine. The second with "!=" doesn't.

     

    This one works, it includes only items whose category is 34 or whose category parent is 34

     

    $q = "SELECT photos.thumb,
    product.id_prod,
    product.title,
    photos.thumb_width,
    photos.thumb_height
    FROM product
    JOIN members ON (product.id_mem = members.id_mem AND mem_group >=1 AND mem_group <100)
    JOIN category ON (product.id_cat = category.id_cat AND (category.id_parent = '34' OR category.id_cat = '34'))
    LEFT JOIN photos ON (product.id_prod = photos.id_prod AND photos.main_photo = '1')
    WHERE product.publish = '1'
    ORDER BY product.id_prod DESC";
    

     

    This one doesn't work, it includes all items published, including those whose category is 34 or whose category parent is 34(which it shouldn't) and the statements are almost exactly alike.

     

    $q = "SELECT photos.thumb,
    product.id_prod,
    product.title,
    photos.thumb_width,
    photos.thumb_height
    FROM product
    JOIN members ON (product.id_mem = members.id_mem AND mem_group >=1 AND mem_group <100)
    JOIN category ON (product.id_cat = category.id_cat AND (category.id_parent != '34' OR category.id_cat != '34'))
    LEFT JOIN photos ON (product.id_prod = photos.id_prod AND photos.main_photo = '1')
    WHERE product.publish = '1'
    ORDER BY product.id_prod DESC";
    

     

    Thanks

  3. I would have thought this would have been beat to death on here by now but I searched for "Check for cookies" and I didn't see this topic.

     

    On a site I'm making, users can't login without cookies inabled.

     

    // I have an included fucntion file and I have this near the top
    if (!isset($_COOKIE['AllowCookies']) OR $_COOKIE['AllowCookies'] != 'Yes') {setcookie("AllowCookies", Yes);} // To check to see if browser accepts cookies
    
    // then on the login page I have
    
    if ($_COOKIE['AllowCookies'] != 'Yes') {echo '<p style="color: red;">Sorry, your cookies are turned off. You must allow them in your browser to login. Thank you</p>';}
    

     

    I searched the web and came up with more verbose examples which makes me wonder if this is good enough or if I'm missing something.

    So my question is, will this do?

  4. It sounds like you're wanting someone to tell you you don't need to learn php.

     

    Well PHP is still the most popular web programming language at this point. It is relatively easy to learn for beginners, and its syntax is similar to C++/Java so those who have desktop application development find it easier to get used to PHP. Not mentioning PHP is specialized to code in dynamic web pages. So yeah, there is a reason why PHP is popular and will be popular.

     

    Maybe you just need to stick to design and farm out any php code you need to have writen, of course you would need to know were to stick the code and have an idea what the coder was talking about. So ...  yes it would be  worth "the next few months to studying PHP".

  5. The stuff you make or are "involved with" to paraphrase you seems like it is or would be generic. You say working with wordpress "you never get to see the PHP files", I don't know what to say about that remark, maybe you haven't really looked.

     

    With that said I have seen some wp sites with generic stuff that looked great but that came from the css side.

     

    Maybe you just need to stick to design and farm out any php code you need to have writen, of course you would need to know were to stick the code and have an idea what the coder was talking about. So ...  yes it would be  worth "the next few months to studying PHP".

  6. If your going to do stuff like this get and use firefoxes firebug, firebug color codes the divs, margins, borders and padding on the web page so you can see the styles, it will tell you what the css file name is, the name of the style, what line the style is coming from and the inheritance if any. I think chrome does the same thing.

  7. Well you know that the total width of the container is the width plus padding plus border plus margin don't you?

     

    With that in mind float all divs left add a width that fits and play with the height if needed.

  8. What do you want aligned?

     

    Usually if you want to center h2

     

    .container08 h2{text-align: center;} on the style sheet or in the header

     

    or

     

    <h2 style="text-align: center;">small</h2>

     

    and ...

     

    added

     

    if you want to center container08

     

    .container08 {

    width: 50%;  /* or what ever*/

    margin: 0 auto;

    }

     

     

  9. I don't do it like that but it may be

     

    $q = "Select * From cpanel_users WHERE Usr_Username= {mysqli_real_escape_string($dbc, $Post_Username)}";

     

    This should be close to it.

     

    edited mysqli_real_escape_string after post below

  10. You may have to use sessions, something like this

     

    $a = rand(1, 10);

    $b = rand(1, 10);

    $c = $a + $b;

    $_SESSION['pass_phrase'] = SHA1($c);

     

    // $_POST user_phrase

    if (isset($_POST['answer'])) {

    $user_pass_phrase = sha1($_POST['answer']);

    }

     

    // if a member or if the $user_phrase is correct

    if ($_SESSION['pass_phrase']  == $user_pass_phrase) {

    echo "Correct!";

    }

  11. Thanks for the reply

     

    That query should return rows 1,2, and 5. Both 1 and 2 have an id_parent of 0 and count of 0.

    ....

    What is the output you are trying to get from that data set?

     

    The rows I'm trying to get are 1 2 & 5, the only problem I know of is that last night I was getting a row that had a 0 count a parent 0 with the same sql.

     

    Anyway the sql above should only return rows 1 2 & 5? That's what I want.

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