please fix the error


Posted on 16th Feb 2014 07:03 pm by admin

What is the error in the below code ???
Line number On/Off | Expand/Contract <?php if(array_key_exists_r('email|password', $_POST)) { include_once('database.php'); $sql = "SELECT user_id FROM login WHERE user_name = '" . trim($_POST['email']) . "' AND password='" . trim($_POST['password']) . "')"; $result = mysql_query($sql); print_r($result); if (mysql_num_rows($result)>0){ $row = mysql_fetch_row($result); session_start(); $_SESSION['user_id']=$row[0]; $_SESSION['user_name']=trim($_POST['email']); } }?>

No comments posted yet

Your Answer:

Login to answer
164 Like 42 Dislike
Previous forums Next forums
Other forums

having probem inserting data into db table
hi

i have a table with following columns in it
Code: candidate_id, degree, cgpa, institute

Data type mismatch
Hi,
I am migrating data from algol to c.I mapped real datatype in algol to double datatype in

How to set pass login name from htaccess to php
When the user logs into my members page via htaccess, I'd like to retain the username so that I can

Calender Not Opening
The following code is not loading the javascript calender in another window. It's not doing anything

Get to know your fellow coder
I think it's time we got personal around here. There's a lot of code swapping and a few members kno

What's wrong with my code
sobbing for many days, still don't know why please Help. Why my page isn't posted correctly. In a

"SEO" URLs
Hey, I'm wondering how to go about creating and using these types of URLs. I'm presuming it's PHP th

problems with script
I made a small script wich exchanges points in my website:


<?php
session_start

Problem with "dynamic" index page
Hi. I have one question. In my index.php page I have this kind of code:
Code: // listaa sivut

Issues: PHP Forms -Clearing
I've tried looking online before actually asking for help, but I've been looking for about the past

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash