Jump to content
  • Advertisement

formulax12

Member
  • Content Count

    5
  • Joined

  • Last visited

Everything posted by formulax12

  1. I keep getting errors when I try to log in to my MySQL database. I just installed EasyPHP-5.3.8.0 (WAMP package). I am using this book to learn how to code in PHP and MySql. In the MySQL tutorial in the book, the author says that to access the MySQL database, you must first access the Windows Command Prompt. Ok, I have done that, now the author tells me to write this exactly the way he wrote it, in the command prompt window: “\Program Files\EasyPHP-5.3.8.0\mysql\bin\mysql” –u root When I click enter I get a: ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES) Ok, so I access the server to see if MySQL has a different predetermined username and password by writing this on my Firefox address bar: “http://127.0.0.1/home/”, and it says on that page that: MySQL Username: root MySQL password: (Its blank, no password) MySQL database host: 127.0.0.1 Ok, So I go back in to my MySQL command prompt window put the –p right after the –u root, and when it prompts me to put in a password, I don’t put anything in there, I just click enter. “\Program Files\EasyPHP-5.3.8.0\mysql\bin\mysql” –u root –p Password: (I don’t put anything, I just simply press enter) [A bunch of gibberish is shown here such as MySQL connection id, my server version, and copyright and trademark information] Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement. mysql> The author than tells me to place this command right after the “mysql>”: mysql>SHOW databases; (I click enter after writing that command) [A database is shown I believe, with a bunch of information such as: information_schema, mysql, test, 3 rows in set (0.03 sec)] The author than tells me to write down this command so I can create a database: mysql>CREATE DATABASE practicedatabase; (that’s the name of the database that I created lol) After doing that the author than tells me to create a user who can access just my “practicedatabase” database and all its objects by entering the following command: mysql>GRANT ALL ON practicedatabase.* TO ‘(username I chose goes here)’ IDENTIFIED BY ‘(password I chose goes here)’; Ok, after writing that command and clicking enter, the author than says to write the command “quit” to exit and then rerunning MySQL the way I did before but using the username and password that I chose: *For all context and purposes, let’s just say that the username I chose was “sunnyd” and the password I chose was “tastesgood” “\Program Files\EasyPHP-5.3.8.0\mysql\bin\mysql” –u sunnyd –p Password: ********** (password is: tastegood) Here is the problem, when I click enter, instead of login in to the database that I have just created, per what it says in the book, following the instructions and going back (scrolling up the command prompt window to see what I have written) various times to make sure I didn’t do anything wrong, I get this: ERROR 1045 (28000): Access denied for user ‘sunnyd’@’localhost’ (using password: YES) My question is, why is this error appearing? Note: If I log in by leaving the password empty like I did before: “\Program Files\EasyPHP-5.3.8.0\mysql\bin\mysql” –u sunnyd –p Password: (I left it empty and then pressed enter) [A bunch of gibberish is shown here such as MySQL connection id, my server version, and copyright and trademark information] After doing that I tried following the instructions by trying to access the database: mysql>USE practicedatabase but I get an error: ERROR 1044 (42000): Access denied for user ‘’@’localhost’ to database ‘practicedatabase’ I have no idea what is going on, its my first time using MySQL and trying to create a database. So much for following the instructions in a book... For those interested in knowing what book I am using, its called "Learning PHP, MySQL & Javascript by Robin Nixon"
  2. Adobe Dreamweaver and Adobe Fireworks is a very good combination. You can use Adobe Fireworks to create a mock up site, than either export it in to Dreamweaver or write your own HTML/XHTML and CSS code, while using the mock up site you created in Fireworks as a blue print.
  3. I am completely new to programming in Javascript (I have started a few of days ago actually lol). Well, I am trying to create a "placeholder text" for each of my "input fields", and as you can see I have created a separate Javascript Function for each "onblur code snippet", "onfocus code snippet", etc. My problem is that IF I would want to add/create more "input fields", than I would have to create more Functions for each different section: "onblur, onfocus, etc." as I have done for my First Name and Last Name "input fields", which will than make my Javascript code too long and very burden... My question is: how can I combine the "placeholder text" Javascript Functions that I have inserted in to the "head" section in to one Javascript Function, so that only one Function can execute the "placeholder text" Javascript code on all the different "input fields" that I would like to create, to make my Javascript code look more simpler and neat? Thanks guys! Example, one Javascript Function that will execute all the different placeholder text for: - A placeholder text for First Name - A placeholder text for Last Name - A placeholder text for Email - A placeholder text for password etc, etc... <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Javascript Practice</title> <script type="text/javascript"> //For the first input field: "First Name" function fnameBlur(x) { document.getElementById(x).value='First Name'; } function fnameFocus(x) { document.getElementById(x).value=''; } //For the second input field: "Last Name" function lnameBlur(x) { document.getElementById(x).value='Last Name'; } function lnameFocus(x) { document.getElementById(x).value=''; } </script> </head> <body> First name: <input type="text" onblur="fnameBlur(this.id)" onfocus="fnameFocus(this.id)" id="fname" value="First Name" /> <br /> Last name: <input type="text" onblur="lnameBlur(this.id)" onfocus="lnameFocus(this.id)" id="lname" value="Last Name" /> </body> </html>
  4. Thank you guys for the help, I have been using the method of putting all my Javascript codes in the "header" and/or in an external Javascript file and placing the onload tag on my body to call up my code before the page finishes loading. I have also started looking at and starting using JQuery and from what I am seeing, it seems to be a lot more simpler than regular Javascript. I find it really simple to create, add, and call functions with less code than using Javascript. A question I have is if JQuery is the exact same thing as Javascript, as in it has all the same functionalities and power of Javascript but written in a slightly different and easier format to understand and implement? Just like C# (and Java, from what I have read online) was created to be a simpler, yet powerful programming language with an easier learning code, as an alternative to learning C/C++, but having the problem of high memory usage (I dont quite completly understand what that means, but from what i read, I believe it stands for being alot "slower" to execute/load code than C/C++). If that is the case, does JQuery have the same problem as C#? Last thing I want is for my web pages to load up a lot slower than if I use Javascript instead. I really appreciate you guys helping me out. I have decided to get in to Javascript, PHP, and MySQL since I am in the process of creating a simple Web Application that I have planned out (I have documented the few features that I am trying to implement). This application I have started designing and developing is just for personal learning/training purposes to increase my understanding and skills of Dynamic and Server Side Coding (Javascript, PHP, and MySQL). I am proficient in using (from 1 to 5, 5 being the best) Photoshop (5), Illustrator (4), FireWorks (5, I use it constantly in combination with Photoshop to create my design and project mock-up works, I personally think that its the best program out there to create mock up (conceptual) looks for projects you will like to create/design lol), Dreamweaver (4), HTML (4) and CSS (4). I am familiar in Flash (3), and well learning Javascript (recently, so a simple 1 or 0 lol), same goes for PHP and MySQL. I have been using the O'Reilly books and w3schools to learn what I know and sort of understand so far. But thank again guys for showing me how to combine two functions, w3schools and the O'Reilly books that I have read so far don't teach you that, less functions = less code, meaning a cleaner and more organized markup. The article you posted "rip-off" it really clarified a lot of information, one of the best articles out there for web developers lol, Thanks. (BTW I apologize for writing so much )
  5. Thank you so much, the code works perfectly when placed in the body right after the "input fields". I would like to ask, how could i convert that code so it can execute when I place it instead in the "header"? I ask that because I would like to keep all my Javascript code's either in the header or in an external filesheet, so i could separate my HTML code from my Javascript code, just like I do with my CSS code which I have it placed in an external filesheet, thanks I really appreciated the help. For example: Instead of placing the Javascript Function in the "body" right after the "input fields"... <body> First name: <input type="text" id="fname" value="First Name" /> <br /> Last name: <input type="text" id="lname" value="Last Name" /> <script type="text/javascript"> function blurHandler(element, defaultValue) { if(element.value == '') { element.value = defaultValue; } } function focusHandler(element, defaultValue) { if(element.value == defaultValue) { element.value = ''; } } function inputHelper(elementId) { var element = document.getElementById(elementId); var defaultValue = element.value; element.onblur = function() { blurHandler(element, defaultValue); } element.onfocus = function() { focusHandler(element, defaultValue); } } inputHelper('fname'); inputHelper('lname'); </script> </body> And placing it instead here in the "header", cause I have noticed that the Javascript code only executes when placed in front of the "input fields", but doesn't execute when I place it in the "header". <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Javascript Practice</title> <!--placing the Javascript code here in the header.--> </head>
  6. Learning and inproving my Web Programming and Web Development skills!
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!