Call to undefined function mysql query with Login

0 votes

When I run this PHP code I am getting a fatal error.

Code

    <?php


    $user = 'root';

    $password = 'root';

    $db = 'inventory';

    $host = 'localhost';

    $port = 8888;


    $link = mysqli_init();

    $success = mysqli_real_connect(

       $link,

       $host,

       $user,

       $password,

       $db,

       $port

    );


    ?>

    <?php

    $username = $_POST['username'];

    $password = $_POST['password'];

    $sql = mysql_query("SELECT * FROM login WHERE username = '".$_POST['username']."' and password = '".md5($_POST['password'])."'");

    $row = mysql_num_rows($sql);

    if($rom > 0 )

    {

      session_start();

      $_SESSION['username'] = $_POST['username'];

      $_SESSION['password'] = $_POST['password'];

      echo "login done";

    }else {

      echo "fail login ";

    }

The Error

PHP Fatal error: Uncaught Error: Call to undefined function mysql_query() in /Applications/MAMP/htdocs/lprapp/config.php:23 Stack trace:#0 {main} thrown in /Applications/MAMP/htdocs/lprapp/config.php on line 23

Can someone help me with this issue?

May 1, 2022 in Other DevOps Questions by Kichu
• 19,050 points
401 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Other DevOps Questions

+1 vote
1 answer

How to deal with non-fast forward errors?

This error is faced when git cannot ...READ MORE

answered Jul 3, 2018 in Other DevOps Questions by Sophie may
• 10,610 points
30,234 views
0 votes
1 answer

SonarQube cannot connect to JIRA 7 with REST API

The JIRA Plugin is not compatible with JIRA 7 ...READ MORE

answered Jul 5, 2018 in Other DevOps Questions by Kalgi
• 52,360 points
729 views
0 votes
1 answer

Unable to integrate SonarQube analysis results with VSTS Build Summary

This was caused by passing a null ...READ MORE

answered Jul 23, 2018 in Other DevOps Questions by Kalgi
• 52,360 points
1,210 views
0 votes
1 answer

How to integrate OnPrem Azure DevOps Server with the cloud one?

When I go to Project > Boards ...READ MORE

answered Feb 11, 2022 in Other DevOps Questions by Bhavitha
• 1,000 points
425 views
+1 vote
2 answers

Scp Php files into server using gradle

Tru something like this: plugins { id ...READ MORE

answered Oct 11, 2018 in DevOps & Agile by lina
• 8,220 points
1,212 views
0 votes
1 answer

How do I create folder under an Amazon S3 bucket through PHP API?

Of Course, it is possible to create ...READ MORE

answered Apr 24, 2018 in AWS by anonymous
10,982 views
0 votes
1 answer

Failure uploading Image on AmazonS3 with PHP SDK

Try this, I took it out from ...READ MORE

answered May 4, 2018 in AWS by Cloud gunner
• 4,670 points
3,776 views
0 votes
1 answer

Trying to call AWS API via PHP

Try using AWS SDK for PHP, Link ...READ MORE

answered Jun 6, 2018 in AWS by Cloud gunner
• 4,670 points
1,490 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP