5
Contributors
10
Replies
70
Views
2 Months
Discussion Span
Last Post by rubina_3
Featured Replies
  • https://www.daniweb.com/programming/threads/435023/read-this-before-posting-a-question Read More

  • 2

    Yeah. We don't do your work for you. You can hire some of us for a lot of $$ to do it if you want, or you can make an effort, post your code and errors here, and we may decide to help you. Read More

  • 2

    P.S. MySQL - easy to use. PHP - easy to use incorrectly, but not simple if you want to do it correctly. Consider it C++ for web servers, and program it accordingly. Read More

  • 2
    diafol 3,708   2 Months Ago

    Do you think that showing your code may help? Mysql functions are deprecated and have been removed in php. That's not the problem here though. Read More

  • 1
    diafol 3,708   2 Months Ago

    How do you expect us to help you unless you show your code? Crystal balls and all that... Read More

2

Yeah. We don't do your work for you. You can hire some of us for a lot of $$ to do it if you want, or you can make an effort, post your code and errors here, and we may decide to help you.

Edited by rubberman

2

P.S. MySQL - easy to use. PHP - easy to use incorrectly, but not simple if you want to do it correctly. Consider it C++ for web servers, and program it accordingly.

0

ok let's just forget about that ..now i'm having another problem...my xamp server was working fine but now whenever i try to run any program now it gives mysql_num_rows() expects parameter 1 to be resource, boolean given...it was working fine and the condition are not false as well...all the program used to run correctly but now i don't know what happened....do i need to reinstall my xamp server??

2

Do you think that showing your code may help? Mysql functions are deprecated and have been removed in php. That's not the problem here though.

0

it was working fine and i haven't changed anything in the code..now it gives that error in every program....if you still want to see the code then i can show you....but it was working earlier...

1

How do you expect us to help you unless you show your code? Crystal balls and all that...

1

I agree you are hiding too much. How about one thing. Did you open a SQL command line and see if the server is running?

1

PHP no longer supports MySQL APIs. It has been using MySQLi APIs for years. Most all calls need the resource identifier returned when you open the database. Anyway, as others have said, show your code. Until you do we can't help you any further.

Edited by rubberman

0

this is login page code....the sql error is in each page

<?php

session_start();
ob_start();

include "config.php";

$error = '';

if(isset($_POST["submitted"]) && $_POST["submitted"] == "yes")
{
    $username = trim(strip_tags($_POST['username']));
    $user_password = trim(strip_tags($_POST['passwd']));
    $encrypted_md5_password = md5($user_password);

    $validate_user_information = mysql_query("select * from `userinfo` where `username` = '".mysql_real_escape_string($username)."' and `password` = '".mysql_real_escape_string($encrypted_md5_password)."'");

    if($username == "" || $user_password == "")
    {
        $error = '<br><div class="info">Sorry, all fields are required to log into your account. Thanks.</div><br>';
    }
    elseif(mysql_num_rows($validate_user_information) == 1) 
    {

        $get_user_information = mysql_fetch_array($validate_user_information);
        $_SESSION["VALID_USER_ID"] = $username;
        $_SESSION["USER_FULLNAME"] = strip_tags($get_user_information["fullname"]);
        header("location: profile.php?page_owner=".base64_encode($username));
    }
    else
    {
        $error = '<br><div class="info">Sorry, you have provided incorrect information. Please enter correct user information to proceed. Thanks.</div><br>';
    }

}
?>

`

Edited by rubina_3

Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.