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 647613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:44:29+00:00 2026-05-13T21:44:29+00:00

I created the following script to query a table and return the first 30

  • 0

I created the following script to query a table and return the first 30 results. The query returns 30 results, but they do not have any text or information. Why would this be?

The table stores Vietnamese characters. The database is mysql4.

Here’s the page: http://saomaidanang.com/recentposts.php

Here’s the code:

<?php
  header( 'Content-Type: text/html; charset=utf-8' );
 //CONNECTION INFO
 $dbms = 'mysql'; 
 $dbhost = 'xxxxx';
 $dbname = 'xxxxxxx';
 $dbuser = 'xxxxxxx';
 $dbpasswd = 'xxxxxxxxxxxx';    
 $conn = mysql_connect($dbhost, $dbuser, $dbpasswd ) or die('Error connecting to mysql');
 mysql_select_db($dbname , $conn);

 //QUERY
 $result = mysql_query("SET NAMES utf8");
 $cmd = 'SELECT * FROM `phpbb_posts_text` ORDER BY `phpbb_posts_text`.`post_subject` DESC LIMIT 0, 30 '; 
 $result = mysql_query($cmd);
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="ltr">
<head>
<title>recent posts</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
 <p>

<?php 
 //DISPLAY
 while ($myrow = mysql_fetch_row($result))
 {
  echo 'post subject:';
  echo(utf8_encode($myrow ['post_subject']));
  echo 'post text:';
  echo(utf8_encode($myrow ['post_text']));
 }
?>
 </p>
</body>
  • 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-13T21:44:29+00:00Added an answer on May 13, 2026 at 9:44 pm

    Try using mysql_fetch_assoc() instead of mysql_fetch_row()

    • The former returns an array with each
      result column stored in an array
      offset, starting at offset 0.
    • The later returns an associative
      array of strings where the column as
      used as keys.

    And in your program you are using the result as an associative array:

    $myrow ['post_subject']
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created a lightbox using the following script: <script type=text/javascript> $(document).ready(function(){ $(.BtnAction).click(function(){ var objPopup
I have created a file called untitled1.cpp in dev-cpp with the following script: #include
I have the following script to create a table: -- Create State table. DROP
I have the following query that selects a friend request script that shows the
Based on a similar casestudy I've created the following bit of script to reveal/hide
The following script creates symlinks as expected, but the original file can never be
I thought the following script will create div element but I got nothing output
I'm attempting to create a table for monitoring purposes using the following script: $w3wppriv
In MySQL I have to check whether select query has returned any records, if
I have the following two mySQL tables with the 'child' table having a DELETE

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.