Jump to content

Newbie MYSQL question


andrw

Recommended Posts

Hey there!

Im andrew and I am a complete php and mysql noob. I want to learn more.

my question is:

if someone inputs something into a form, how do i check the same row in the mysql database?

 

example:i go to the form and i put in a username, andrw. then the script searches for a value in the database in the column Username with a value andrw, and the script prints out the password (in the column next to andrw (password column), but in the same row).

 

here is the picture of my question:

2hrmr02.png

the blue is the value entered | the red is the value that is displayed (the red is pointing to the 585878.... one, not the 5w86 one                      THESE VALUES ARE NOT REAL. I RANDOMLY PRESSED KEYS!!!!

Link to comment
Share on other sites

Why are you not hashing the passwords?

 

This is just a test. I didn't even insert into the database using a form and PHP, I just inserted with the insert button on PHPmyadmin. I would hash on a real service.

 

@jxrd: Thanks!

Link to comment
Share on other sites

1 more problem:

 

I am getting this response:

 

Resource id #7

 

Tell me what im doing wrong.

 

Here is a pic of my database table:

30rr7ee.png

My code is:

<?php
include "conn.php"; //database connect
$incoming = $_GET['redirect']; //GET a value
$original = mysql_query('SELECT * FROM redirect WHERE redirect="$incoming"') or die(mysql_error());  //stuff....
echo $original; //echo the selected value from database

?>

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.