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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:08:25+00:00 2026-06-06T09:08:25+00:00

here is my db connection code and query code: // Connecting, selecting database $link

  • 0

here is my db connection code and query code:

// Connecting, selecting database
$link = mysql_connect('MySQLA22.webcontrolcenter.com', 'shudson', '*******')
   or die('Could not connect: ' . mysql_error());

mysql_select_db('henrybuilt') or die('Could not select database');

$sql = "SELECT ID, vcImageName FROM corp_images WHERE idPage = 6";
$query = mysql_query($sql) or die ("Error");
  • There is no ‘or die’ error upon connecting, selecting, or querying
  • There is no error_log file
  • The sql query executes if I run it in my sql browser

What is going on???

  • 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-06-06T09:08:26+00:00Added an answer on June 6, 2026 at 9:08 am

    It appears correct…try adding this adapted code from the manual to further debug and see what you learn:

    // This shows the actual query sent to MySQL, and the error. Useful for debugging.
    if (!$query) {
        $message  = 'Invalid query: ' . mysql_error() . "\n";
        $message .= 'Whole query: ' . $sql;
       die($message);
    }
    
    // Use result
    // Attempting to print $result won't allow access to information in the resource
    // One of the mysql result functions must be used
    // See also mysql_result(), mysql_fetch_array(), mysql_fetch_row(), etc.
    while ($row = mysql_fetch_assoc($query)) {
        echo $row['ID'];
        echo $row['vcImageName'];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's some code: OdbcConnection connection = new OdbcConnection(@DRIVER={MySQL ODBC 5.1 Driver};SERVER= + ip +
// todo: create the connection here // Construct the query string. You were already
Here's some basic code to create a ListViewGroup, add it to the Groups collection
Here's as far as I understand it: Client & Server make connection Client sends
Here's the class package db; import java.io.File; import java.io.FileInputStream; import java.sql.Connection; import java.sql.DriverManager; import
Converting to ODB.NET from System.Data.OracleClient and need help converting my connection string. Here is
I'm trying to get a std::string from my database using mysql connexion Here is
I need to work on multiple database, and below is my current code. Following
In my DAL I write queries like this: using(SQLConnection conn = connection string here)
I am trying to use ASP to create a connection to my database and

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.