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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:30:22+00:00 2026-06-11T14:30:22+00:00

<?php include (account.php) ; ( $dbh = mysql_connect ( $hostname, $username, $password ) )

  • 0
<?php

include ("account.php") ;

( $dbh = mysql_connect ( $hostname, $username, $password ) )
        or    die ( "Unable to connect to MySQL database" );
print "Connected to MySQL<br>";

mysql_select_db($project);

$number =   NULL ;
$username   =   $_POST["username"];
$priority   =   $_POST["priority"];
$category = $_POST["category"];
$incident_description = $_POST["incident_description"];


$sql  =   "insert into incident values ( NULL,       '$username','$priority','$category','$incident_description',curdate(),curtime() )" ;

mysql_query ( $sql )    or   print ( mysql_error ( ) );

$credentials = "select * from Credentials where ("username" = '$username' ,"password" =  '$password' , "email_address" = 'email_address')" ;

print $credentials;

$result = mysql_query ($credentials) or print (mysql_error ( ) );

$howManyRows = mysql_num_rows ( $result);

//if $howManyRows is positive continue process to update database with sql,if not,die.
?>

There is an html code for a form on another file hence the $_POST, but I don’t think it s necessary to show it here since I need the right syntaxes on this php file.

With the part from the $credentials I need help with how to compare the values in the html form (username,password,email_address) with values in the table "Credentials" from the database?I need to do this in order to authorize the values to carry on the process.
The syntax I got there isn’t right at the moment because it doesn’t execute it properly. I just don’t know how to compare the two.
This whole thing works up until the mysql_query ( $sql ) or print ( mysql_error ( ) ) line.

Suggestions would be nice.I apologize for the long question!

PS: columns for the Credentials table are username,password,email_address as well!

  • 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-11T14:30:23+00:00Added an answer on June 11, 2026 at 2:30 pm

    the problem is here

    $credentials = "select * from Credentials where ("username" = '$username' ,"password" =  '$password' , "email_address" = 'email_address')" ;
    

    change to

    $credentials = "select * from Credentials where `username` = '$username' and `password` =  '$password' and  `email_address` = 'email_address'" ;
    

    The problem is in query, when you want to check multiple values use AND in WHERE clause.

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

Sidebar

Related Questions

<?php session_start(); include(connection.php); if(isset($_SESSION['uname'])) { header(location:account.php); die(); } ?> <!DOCTYPE html PUBLIC -//W3C//DTD XHTML
With include('basemodel.php'); I get Fatal error: Class 'BaseModel' not found in C:\xampp\htdocs\allsides\account\model.php on line
Following structure: apps/backend/ apps/frontend/ modules/ account/template/_menu.php account/template/test.php settings/template/indexSuccess.php I do include _menu in test.php
I have a php page that connects to a mysql database. I know that
I have a php script which needs to connect to a database. The credentials
When i use php include to include a page in my website all the
This is user.php: include(databse.php);//retrieving successfully first name and lastname from databse file into user.php
In my live site I have php include() and require() that have full path
<?php include ../music/php/logic/core.php; include ../music/php/logic/settings.php; include ../music/php/logic/music.php; $top = At world's end; // create
I have a php file that looks like this: <?php include(config.php); // put the

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.