Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
J

Jon Heather

@Jon Heather
About
Posts
2
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Display images from MySQL database using PHP help needed please !!!
    J Jon Heather

    You dont necessarily have to have a seperate PHP page/script serve up the image, you could base64 encode the stream and embed it into your markup as you asked. Assuming you have a variable, for example $imagestream that equals the image field from your table row access routine, you could do this:

    ![?](data:image/jpg;base64,' . base64_encode($imagestream) . ')';
    ?>

    This works well for reasonably small to medium images, but be aware of two things: The page load time is increased as the image data is encoded in the HTML (actually bloated). Be sure your mime type is correct for the image. :)

    Linux, Apache, MySQL, PHP database help question php mysql

  • I want to clear something about PHP and HTML (newbie)
    J Jon Heather

    Just to clarify aswell: = is an assignment operator. == is the comparison operator as mentioned above. === is another comparison operator I call identity, which checks for equality AND type. As PHP is not strongly typed, a variable can change types dynamically at runtime. Example:

    $a = 2;
    $b = "2";

    A comparison would be like this:

    if($a == $b)
    {
    // Do something.
    }

    ..would be TRUE, as they have the same value, but one is an integer and one is a string.

    if($a === $b)
    {
    // This wont happen.
    }

    .. would be FALSE, because they have matching values but different types! For me, understanding this in the beginning helped me to write reliable condition tests for websites and applications.

    Linux, Apache, MySQL, PHP php html
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups