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

The Archive Base Latest Questions

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

I am trying to do the following… select all columns from the table hqfjt_chronoforms_data_addemailtemplate

  • 0

I am trying to do the following… select all columns from the table hqfjt_chronoforms_data_addemailtemplate, then echo the data from each record, from the columns emailformname and emailformmessage. I am using the following code but am getting a bunch of errors, I am just learning php so it is probably a bit wrong :-S .

<?php
    $query = mysql_query("SELECT * FROM hqfjt_chronoforms_data_addemailtemplate") or die(mysql_error());
    foreach($query as $detail) {
        echo $emailarray->emailformname;
        echo $emailarray->emailformmessage;
    }
?>
  • 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-27T15:12:56+00:00Added an answer on May 27, 2026 at 3:12 pm

    As mentioned, it is probably better to learn PDO for those just learning. It is more secure, more information and a tutorial can be found here:
    http://net.tutsplus.com/tutorials/php/why-you-should-be-using-phps-pdo-for-database-access/

    If you want to use objects with a mysql query, something like this will allow you to do so:

    <?php
    mysql_connect("hostname", "user", "password");
    mysql_select_db("mydb");
    $result = mysql_query("select * from mytable");
    while ($row = mysql_fetch_object($result)) {
        echo $row->user_id;
        echo $row->fullname;
    }
    mysql_free_result($result);
    ?>
    

    http://php.net/manual/en/function.mysql-fetch-object.php

    If you would like to do what Frits mentioned, then something like this will achieve your result:

    while ($row = mysql_fetch_assoc($result)) {
        echo $row["userid"];
        echo $row["fullname"];
        echo $row["userstatus"];
    }
    

    http://php.net/manual/en/function.mysql-fetch-assoc.php

    There is also arrays as an alternative:

    http://php.net/manual/en/function.mysql-fetch-array.php

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying out the following query: SELECT A,B,C FROM table WHERE field LIKE 'query%'
I have been trying the following but always fails, roomTypeSQL = SELECT spftype FROM
I am trying following, 1. Get response using Ajax from the users selection which
I'm trying the following: CREATE TABLE Table1 ( RecordNo autonumber, --error here! PersonId varchar(50),
I'm trying the following code http://code.google.com/apis/ajax/playground/#change_the_playing_video It works well when runned from the playground
I am currently trying the following xpath //tr[normalize-space(td/text())='User Name'] to get all the tr
I am trying following query to show all of my user at user page...
I want to select some data from db and store in an array. Suppose
Iam trying the following, the php file, //-----------------------------------------------------------------------------getData.php----------------------------------------------------------- <?php echo '<link rel=stylesheet href=media/styles.css> <script
I was trying the following example of I/O ports from here . #include<stdio.h> #include<unistd.h>

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.