Jump to content

rockindano30

Members
  • Posts

    141
  • Joined

  • Last visited

    Never

Everything posted by rockindano30

  1. hello all, i have a problem. this line here says that i have 0 records SELECT * FROM users WHERE Uname='user1' AND Pword='user1' but i realy have on record with user name (Uname) user1 and Password (Pword) user1 but if i do this it does show my record SELECT * FROM users WHERE Uname='user1'; and it also says that i have 0 records if i use SELECT * FROM users WHERE Pword='user1'; any help?
  2. why won't this give me or show me my records? SELECT * FROM users WHERE Uname='{$Uname}' AND Pword='{$Pword}';
  3. or it doesn't even display any records also if i use select * from users where Pword='user1'; im using MD5() to encrypt the Pword when its being add into db
  4. yes, there are two records that im using for testing. it does display it the record with select * from users where Uname='user1'; but not with select * from users where Uname='user1' and Pword='user1';
  5. Hello all i'm having a little difficulties with this sql syntax. SELECT * FROM users WHERE Uname='user1' and Pword='user1'; with the above sql syntax it returns 0 records and with SELECT * FROM users WHERE Uname='user1'; it returns one record. now i have two records in this database but having this problem. please help.
  6. well thank you darkwater and others for your help. but this one is a dead project as of may 12, 2008 4:06
  7. <table width="100%" border="0" cellspacing="0" cellpadding="1"><form method="post" action="searchemps.php"> <tr> <td colspan="4"><font style="font-size:12px; color: #000000">Type in name of employee to search:</font></td> </tr> <tr> <td width="22%"><font style="font-size:12px; color:#000000">First Name: </font></td> <td width="29%"><input type="text" name="search" size=15 maxlength=25></td> <td width="21%"><font style="font-size:12px; color:#000000">Last Name:</font></td> <td width="28%"><input type="text" name="search2" size=15 maxlength=25></td> </tr> <tr> <td colspan="2"><input type="Submit" name="Submit" value=" " style="background:url(images/searchbutton.png) no-repeat center; height:35px; width:70px; border:0px; cursor:pointer" /> </form></td> <td colspan="2"><form method="post" action="allKeys.php"> <input type="submit" name="vall" value=" " style="background:url(images/viewallbutton.png) no-repeat center; height:35px; width:70px; border: 0px; cursor: pointer" /> </form> </td> </tr> </table> </div> <div class="p" style="clear:both"> <div align="center"> <?php if(!($db = @ mysql_connect('server', 'username', 'password'))) { echo 'Error: Could not connect to our database sorry for any inconvience.<br /> Please try at a later time.'; exit; } //select which database you want to edit mysql_select_db("db name); $vall=$_POST["vall"]; if(!isset($vall) || empty($vall)) { print"<p>No employees in Database."; } else{ $emp_id=$_GET["emp_id"]; //get the mysql and store them in $result //change whatevertable to the mysql table you're using //change whatevercolumn to the column in the table you want to search $query = "SELECT e.*, k.*, d.dept FROM employees as e, emp_keys as k, departments as d WHERE e.emp_id = k.emp_id AND d.k_id = k.k_id"; $result = mysql_query($query); //grab all the content while($r=mysql_fetch_array($result)) { //the format is $variable = $r["nameofmysqlcolumn"]; //modify these to match your mysql table columns $dept=$r["dept"]; $asscc=$r["accss"]; $Fname=$r["Fname"]; $Lname=$r["Lname"]; $email=$r["email"]; $key_num=$r["key_num"]; $emp_id=$r["emp_id"]; ?> <table width="100%" border="0" cellpadding="1" cellspacing="0" class="table1"> <tr> <td width="14%"><font face="Arial, Helvetica, sans-serif"><?php print $dept; ?></font></td> <td width="17%"><font face="Arial, Helvetica, sans-serif" style="color:#CC6600"><?php print $Fname." ".$Lname; ?></font></td> <td width="28%"><font face="Arial, Helvetica, sans-serif"><?php print $email; ?></font></td> <td width="10%"><font face="Arial, Helvetica, sans-serif"><?php print $key_num; ?></font></td> <td width="50%"><font face="Arial, Helvetica, sans-serif"><?php print $asscc; ?></font></td> <td width="50%"> <?php print"<a href='delete.php?emp_id={$emp_id['emp_id']}'>Remove</a><br />";?> </td> </tr> </table> <?php }//end while loop } ?>
  8. nothing no output. i think i'm just going to give up and trash this project.
  9. sql line on my cmd prompt i have posted the output of the sql syntax that dark told me to run.
  10. mysql> SELECT d.*, k.*, e.* FROM employees as e, departments as d, emp_keys as k LIMIT 1 \G; *************************** 1. row *************************** dept_id: 1 dept: City Manager's phone: 383-1800 k_id: 1 emp_id: 1 key_num: 3456 accss: data room, office emp_id: 1 dept_id: 1 Fname: Danny Lname: Vera email: dvera@ci.edinburg.tx.us 1 row in set (0.00 sec) ERROR: No query specified mysql>
  11. it doesnt give me an error did the copy/paste but how can i copy cmd prompt
  12. i dont know how to copy to and from cmd prompt
  13. that syntax gives me a an syntax error in my mysql client
  14. it has to be a sql syntax problem but i can seem to figure it out.
  15. k i ran the query in mysql client and it only displays the same thing half the records
  16. it displays each employee thirty times and there are thirty employees. and if remove the while statement it doesn't display anything
  17. k removing that displays all records (the whole table) thirty time
  18. k heres an example: Department | Employee name | email | key_num | access | remove ------------------------------------------------------------------------------------------- Public Roxy Gomez ventura@mail.com 08998 blank Remove
  19. lol no i'm not connecting to that, edit that part for the forum
  20. this file is called allKeys.php oh yeah i forgot to type in that quote there my bad but thats not the problem. i have been breaking my head in trying to find why it only displays half my records
  21. yes i'm connecting. as i mentioned it does everything works except that it only displays half my records
×
×
  • 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.