Jump to content

joeysarsenal

Members
  • Posts

    91
  • Joined

  • Last visited

    Never

Everything posted by joeysarsenal

  1. well how can i go about adding many .md5 passwords into one table my code is as use plaincart; # # Table structure for table 'members' # CREATE TABLE `members` ( `member_id` int(11) unsigned NOT NULL auto_increment, `firstname` varchar(100) default NULL, `lastname` varchar(100) default NULL, `email` varchar(100) NOT NULL, `city` varchar(100) NOT NULL, `address` varchar(100) NOT NULL, `postcode` varchar(100) NOT NULL, `login` varchar(100) NOT NULL default '', `passwd` varchar(32) NOT NULL default '', PRIMARY KEY (`member_id`) ) TYPE=MyISAM; # # Dumping data for table 'members' Populating the table is below. <?php /* Populate The Staff Table ** Use an Include file to open the database */ include( "connect.inc" ); $sql = "DELETE FROM members"; //drop all data , then insert mysql_query($sql ); $sql = "INSERT INTO members VALUES " . "(NULL,'Joe','m','leboe@hotmail.com','mefsdflb','69 fook street city','4444','joe','joe'), " . "(NULL,'Joe1','m1','sdfdsdsf@hotmai1l.com','melfsdfb1','691 fook street city','4441','joe1','joe1')"; if(mysql_query($sql)){ echo("<p>client table successfully populated!</p>"); } else{ print("<p>Error adding to client table: " . mysql_error() . "</p>"); } ?> at the moment its just normal words but i want it encripted and if im going to add 50 user names and passwords i would like it encripted. I googled but no help.
  2. try changing them i use xampp and have never had any problems mabye upgrade ur software
  3. How can i add that to table structer like create table member `member_id int(11) unsigned NOT NULL primary key auto_increment, `password varchar(32) not null, would it then become `password .md5(20) not null. sorry im quiet new :S
  4. having trouble connecting to the database go over your information.
  5. Is there a way to add encripted passwords (md5) on the table fiel so that there are any passwords typed into that field its automatically encripted if there isnt a way how may i go about doing this.
  6. I seem to be getting this error. When trying to create a table and cant seem to find were i went wrong. Code im using is <?php /* create the Staff Table */ $host = "localhost"; $user = "root"; $pass = ""; // include( "../some/wierd/folder/details.inc" ); $Connect = @mysql_connect($host, $user, $pass); if(!$Connect){ echo('<p>Unable to connect to the' . ' database server at this time.</p>'); exit(); } mysql_select_db("plaincart"); $sql = "CREATE TABLE clients(" . "member_id int(4) NOT NULL AUTO_INCREMENT PRIMARY KEY," . "firsname varchar(100) NOT NULL," . "lastname varchar(100) NOT NULL," . "email varchar(100) NOT NULL ," . "city varchar(100) NOT NULL,". "address varchar(100) NOT NULL," . "postcode varchar(4) ," . "login varchar(100) NOT NULL default,". "passwd varchar(32) NOT NULL );"; echo "SQL is " . $sql . "<br />"; if(mysql_query($sql)){ echo("<p>client table successfully created!</p>"); } else{ print("<p>Error creating clients table: " . mysql_error() . "</p>"); } ?> Error creating client table: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'passwd varchar(32) NOT NULL )' at line 1
  7. so i make a table containing citys. whats the code to do a drop down box. Just not 2 sure. Sorry for the unrelated question thought it was better then creating 2 topics
  8. is there a way to make sure that lets say if i want just emails to be in the field it has to be like abc@email.com and if i want to make a dropdown box for city's
  9. teng i took out the * from my delete statement from my old code and it worked like a charm thanks for all ur help *Solved*
  10. Hmm without the star. It deletes most but its not working to stratch when i go to populate there are till 2 products in the table.
  11. <?php /* Populate The Staff Table ** Use an Include file to open the database */ include( "connect.inc" ); */$sql = "DELETE * FROM tbl_product"; //drop all data , then insert mysql_query($sql ); $sql = "INSERT INTO tbl_product VALUES " . "(0, 11, 'Abu Garcia Cardinal CSW172 Fishing Reel', 'A fishing rod !!!!!!!!!', '63.95', '1000', '36d29b9445468ee556caa70d0e7f43b7','36d29b9445468ee556caa70d0e7f43b7', '', ''), " . "(0, 16, 'Abu Garcia Cardinal CSW173 Fishing Reel', 'A fis4hing rod !!!!!!!!!', '62.95', '1000', '','', '', '')"; mysql_query($sql); if(mysql_query($sql)){ echo("<p>Product table successfully populated!</p>"); } else{ print("<p>Error adding to Product table: " . mysql_error() . "</p>"); } ?> still same problem even if i do that. Its just adding on the to table its not deleting anything
  12. Its just puts data over what was already there. Its not deleteing everything if anything.
  13. lol sorry if ive confused you. i do that alot :S ok all i want it to do is delete everything thats inside the table before it inserts.
  14. teng, it works fine if i populate many. And yes i want it to delete everything in the table. so that the table empty then filled with the new information.
  15. i get no error on command but when i go to populate the data into the table it just adds on to what ever was there. Im stuck.
  16. i think the error is coming from my delete * from table Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\MYSQL\Products\Product_Detail.php on line 20 line 20 = $sql = DELETE * FROM tbl_product; thanks for the quick reply
  17. i tried to just delete it, but ended up getting t-string error $sql = DELETE * FROM tbl_product; //drop all data , then insert $sql = "INSERT INTO tbl_product VALUES " . "(0, 11, 'Abu Garcia Cardinal CSW172 Fishing Reel', 'A fishing rod !!!!!!!!!', '63.95', '1000', '36d29b9445468ee556caa70d0e7f43b7','36d29b9445468ee556caa70d0e7f43b7', '', ''), " . "(0, 16, 'Abu Garcia Cardinal CSW173 Fishing Reel', 'A fis4hing rod !!!!!!!!!', '62.95', '1000', '','', '', '')";
  18. how do i incoperate that into the acutall code, do i remove the insert?
  19. i can supply table if u wish, althought its on my laptop.
  20. all i want it to do is. That when i click populate it deletes all the information that is in the table and fills in what i have in code. Like i have a table with name type cost arsenal soccer $50 but in my code ive changed to info to become arsenal soccer-club $50. Cause if i repopulate the data it just duplicates and i dont really want that Thanks in advance
  21. at the moment i have this <?php /* Populate The products Table ** Use an Include file to open the database */ include( "connect.inc" ); $sql = "INSERT INTO tbl_product VALUES " . "(0, 11, 'Abu Garcia Cardinal CSW172 Fishing Reel', 'A fishing rod !!!!!!!!!', '63.95', '1000', '36d29b9445468ee556caa70d0e7f43b7','36d29b9445468ee556caa70d0e7f43b7', '', ''), " . "(0, 16, 'Abu Garcia Cardinal CSW173 Fishing Reel', 'A fis4hing rod !!!!!!!!!', '62.95', '1000', '','', '', '')"; if(mysql_query($sql)){ echo("<p>Product table successfully populated!</p>"); } else{ print("<p>Error adding to Product table: " . mysql_error() . "</p>"); } ?> and im trying to get it so when i go to populate the data it erases whats in there and puts new info in.
  22. How is it possible, to have my login, so that when the username equallys staff 01 staff 02 or admin it opens a different page
  23. thanks for the quick reply, would that go when im authicating the password, or checking if password is correct.
  24. Im not sure how it can be done, but i just want lets say my shopping link (Button) to be seen only if your logged in. Im just not sure how how to go about doing this.
×
×
  • 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.