Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6579633
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:55:22+00:00 2026-05-25T15:55:22+00:00

$query = SELECT * FROM udowers ; $mysqlquery = mysql_query($query); /* IMAGE CREATION */

  • 0

$query = ” SELECT
*
FROM
udowers
“;

    $mysqlquery = mysql_query($query);

/* IMAGE CREATION */
    $lines = mysql_num_rows($mysqlquery);
    // Create a image
        $im = imagecreate(400, 12 * $lines);

    // Set colors
        $background = imagecolorallocate($im, 255, 255, 255);
        $textcolor = imagecolorallocate($im, 255, 0, 0);

/* END IMAGE CREATION */

    if($mysqlquery){
        while($row = mysql_fetch_assoc($mysqlquery)){
           imagestring($im, 3, 5,  $height += $lines * 12, $row['udower'], $textcolor);
        }
    }
    else
    {
        imagestring($im, 3, 5, 5, 'MySQL Error', $textcolor);
    }

    /* IMAGE CREATION */

    // Output the image
        header('Content-type: image/png');

    // Show the image
        imagepng($im);
        imagedestroy($im);


    /* END IMAGE CREATION */

Im trying to get all the names on the column udower from the table udowers, but this doesn’t work. It doesn’t display anything at all. Can you guys help me please?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:55:22+00:00Added an answer on May 25, 2026 at 3:55 pm

    On this line

    $lines = count(mysql_fetch_assoc($mysqlquery));
    

    You are placing the pointer to the end of the results. Thus, inside your while loop it won’t fetch any more results.

    I think you are looking for the number of rows returned on that line, so you should do:

    $lines = mysql_num_rows($mysqlquery);
    

    Also, the line will always be the same, because you do 12 * $lines always. You are creating a variable $height = 12 * $lines;, but you are not using it.

    When you create that variable you should assign it to 0, like so:

    $height = 0;
    

    Then, when you add the string to your image you should do:

    imagestring($im, 3, 5, $height += 12, $row['udower'], $textcolor);
    

    Now that you changed the height to 0, you must adjust for the image height too:

    $im = imagecreate(400, 12 * $lines);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

$result = mysql_query(SELECT * FROM media WHERE path = '$target'); if($row = mysql_num_rows($result)==1) {
$query = mysql_query(SELECT * FROM news WHERE id = '{$_GET['id']}'); $news = mysql_fetch_assoc($query); $sql84
$query = mysql_query('SELECT * from rbf_edades_news order by month DESC '.$limit.''); month and day
$query = mysql_query(SELECT * FROM fruit WHERE color='red' ); while ($row = mysql_fetch_array($query)) {
$result=mysql_query(SELECT * FROM users WHERE pass='.sha1($_POST['mainloginpass']).'); if(mysql_num_rows($result)==1){ it says that mysql_num_rows() expects parameter 1
I have this SQL query: SELECT * FROM IMAGES WHERE IMAGENAME in ('IMG1', 'IMG2',
Take this query: SELECT * FROM MyTable WHERE MyColumn = 'SomeValue' ORDER BY SomeFakeQualifier.MyColumn
OdbcDataReader q = dbc.Query(SELECT * FROM `posts` WHERE `id`= + id.ToString()); if (q.RecordsAffected <
$result = mysql_query(SELECT * FROM project ORDER BY projectid); while($row = mysql_fetch_array($result)) { return(array($row['projectid'],
i have sql query select * from Roles Join Users On Roles.Role=Users.RoleId it return

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.