#16
  1. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: Tut


    PHP3 uses both. 'and/or' is more likely
    <br>
    to be what you want when thinking in
    <br>
    English (like in Perl where you would
    <br>
    say "open (FILE, "< $file") or die;")
    <br>
    while &&/|| are more likely to be what
    <br>
    you want when thinking mathematically:
    <br>
    <br>
    $x = $y || 1;
    <br>
    <br>
    They have different precedences (in Perl
    <br>
    the 'and/or' operators didn't arrive until
    <br>
    Perl5; PHP took them from Perl , but
    <br>
    arguably took &&/|| from C (even if it
    <br>
    was by way of Perl)).
    <br>
  2. #17
  3. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: Tut


    I agree. As I said, I like php. It's perl I haven't much use for. :)
  4. #18
  5. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    I don't know...


    I included lines:
    <br>
    <br>
    $db = mysql_connect();
    <br>
    echo "db: $db<br>";
    <br>
    <br>
    and I got 1
    <br>
    <br>
    Is that OK? Am I connected to MySql?
    <br>
  6. #19
  7. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: I don't know...


    1 means "true" -- That's good, very good. To make use of the connection you assigned to $db, use a few more functions, such as:
    <br>
    <br>
    mysql_select_db("mydatabasename", $db);
    <br>
    <br>
    mysql_query("allYourSQLgosHere",$db);
    <br>
    <br>
    $r = mysql_fetch_array($result);
    <br>
    <br>
    while ($r = mysql_fetch_row($result)) {
    <br>
    <br>
    echo $r[field1]; }
    <br>
    <br>
  8. #20
  9. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: I don't know...


    Thanks,
    <br>
    I figured out that after creating a database you need to run these commands. Everything works fine.
    <br>
    <br>
    mysql> GRANT usage
    <br>
    -> ON mydatabasename.*
    <br>
    -> TO webuser@localhost;
    <br>
    <br>
    and
    <br>
    mysql> GRANT select, insert, delete
    <br>
    -> ON mydatabasename.*
    <br>
    -> TO webuser@localhost;
  10. #21
  11. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: I don't know...


    That's good news. Just in case you wanted to know, however, I was wrong about the 1 meaning "true". I read somewhere else that it is the link reference. This allows you to refer to different connections in one script. Isn't PHP nifty?
  12. #22
  13. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    graphics


    Thank you for the article.
    <br>
    I'm new at this and luckly have been getting it! I do have one question.
    <br>
    After accessing my data (which has bob.gif in it along with name, address etc.) how do I tell it to retrieve a that gif and place it on my page. The gif is in a file called Images.
    <br>
    Thank you for your time.
  14. #23
  15. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    permissions of 777?!?!


    Your brave! how about changing ownership of the directory to whoever you run httpd as... (Usually "nobody") chown nobody:nobody then set the permissions of the pictures as 644 chmod 644. No reason to set the exe bit on a gif, or jpg file....
    <br>
    <br>
    Just an idea....
    <br>
    <br>
  16. #24
  17. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    image on DB vs. filesys.


    is there such a big speed difference when you put the images on a file system like your example vs. placing the images in a BLOB field?
    <br>
    <br>
    r.S.
  18. #25
  19. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: image on DB vs. filesys.


    Can you even store images (binary data) in a BLOB field? Even if you can I would assume that it would be much faster storing them on your filesystem. That way your database won't get immensely bloated.
  20. #26
  21. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: image on DB vs. filesys.


    well the file is gonna have to be stored somewhere anyway, right? so unless there is a huge speed difference it wouldn't really matter... the images are gonna be at most about 20kb in size... it's an online newspaper for my school, so I know the db is gonna grow about 300kb weekly tops including the articles and the images... about 1MB a month... that's not that bad... or is it?
    <br>
    <br>
    BTW, BLOB is for binary data.
    <br>
    <br>
    r.S.
  22. #27
  23. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    mail function


    Would anyone know how to send and HTML email using the mail() function in PHP3 on Linux 6.0 running Apache?
  24. #28
  25. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: image on DB vs. filesys.


    I am interested in storing smallish jpegs in a db not for speed, but since i feel the whole thing is better organised this way. Can anyone tell me the most practical way of getting the images into a DB?
  26. #29
  27. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    problem of giving .phtml file as world readable


    hello friends
    <br>
    on my server my .phtml file only works when they r world readable ...
    <br>
    but that gives my database passwd to ne user on that server...
    <br>
    how to stop him doing that?
    <br>
    I'm new to mysql and php
    <br>
  28. #30
  29. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: mail function


    mail ("send_to_email", "subject", "Body/message", "From_email");

IMN logo majestic logo threadwatch logo seochat tools logo