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
https://forums.phpfreaks.com/topic/161987-newbie-mysql-question/
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

?>

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.