Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Member longislandhub's Avatar
    Join Date
    Jan 2019
    Location
    Commack
    Posts
    38
    Member #
    60353
    Liked
    4 times

    Wink How To Adjust Images With HTML/CSS Using PHP?

    I am learning PHP right now so I am very novice but know HTML & CSS. My brain is a little fried was wondering if someone could help me out with adjusting an image size using this Local Host PHP Code?

    My code is below thank you!





    <?php
    include_once 'includes/dbh.inc.php';
    ?>


    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Title</title>
    </head>

    <body>
    <?php



    $data = "Admin";
    //Created a template
    $sql = "SELECT * FROM players;";
    //Create a prepared statement
    $stmt = mysqli_stmt_init($conn);
    //Prepare the prepared statment
    if (!mysqli_stmt_prepare($stmt, $sql)) {
    echo "SQL statement failed";
    } else {

    //Run parameters inside database
    mysqli_stmt_execute($stmt);
    $result = mysqli_stmt_get_result($stmt);
    $counter=1;

    while ($row = mysqli_fetch_assoc($result)) {
    echo $counter . ". ".$row['name'] . "<br>";
    echo '<img src="' . $row['image'] . '"><br>';
    $counter++;
    }
    }



    ?>


    </body>
    </html>

  2.  

  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,732
    Member #
    5580
    Liked
    718 times
    Do you want to actually change the size of the image permanently (in your database), or just change the size as it is displayed on the web page?

    And also ... you have your images in a directory and the database holds the filename of the image?

    You need to be more specific on what you are trying to do.



Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Tags for this Thread

All times are GMT -6. The time now is 09:53 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com