Jump to content

Liquid

Members
  • Content Count

    6
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Liquid

  • Rank
    Newbie
  1. Im trying to arrange it so that when i upload an image using a php java script file uploader i wrote the image then becomes a url in a database as ive been reading the benefits of not storing the files in a database if its gonna be a lot of them. what is the code i should use to create a url that is then written to the database.
  2. Liquid

    php help getting error

    <?php if ( ! empty( $_POST )) { $con = mysql_connect("localhost","root","NIF123not"); if (!$con) die('Could not connect:' . mysql_error()); mysql_select_db("DSA", $con); mysql_query("INSERT INTO users (username, password) VALUES ('$_POST[username]','$_POST[password]'") or die(mysql_error()); // Retrieve all the data from the "example" table $result = mysql_query("SELECT * FROM users") or die(mysql_error()); // store the record of the "example" table into $row while ($row = mysql_fetch_array( $result )){ // Print out the contents of the entry echo "Username: ".$row['username']; echo " Password: ".$row['password'];} mysql_close($con); }?><html><body><form action="dbtest.php" method="post">username: <input type="text" name="username" />password: <input type="password" name="password" /><input type="submit" /></form></body></html> same issue still doesnt work
  3. <?php if ( ! empty( $_POST )) { $con = mysql_connect("localhost","root","*********"); if (!$con) die('Could not connect:' . mysql_error()); mysql_select_db("DSA", $con); mysql_query("INSERT INTO users (username, password) VALUES ('$_POST[username]','$_POST[password]'") or die(mysql_error()); mysql_close($con); // Retrieve all the data from the "example" table $result = mysql_query("SELECT * FROM DSA") or die(mysql_error()); // store the record of the "example" table into $row $row = mysql_fetch_array( $result ); // Print out the contents of the entry echo "Name: ".$row['name']; echo " Age: ".$row['age']; }?><html><body><form action="dbtest.php" method="post">username: <input type="text" name="username" />password: <input type="password" name="password" /><input type="submit" /></form></body></html> this is my code, it should take whatever i enter in the username and password fields should be entered as data in my databasei get this errorYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
  4. Hi, so im eventually gonna try to compare two user entered dates and determine which is greater then the other, i assume i can just do that part with parse and get the ms since 1970, the part im having difficulty with is take the input from the input boxes and using those as the dates. all the tutorials and information ive found sends it to a server database to get info, i just want to almost turn them into a string. i know how to do this in java, but im lost as to how to do this in javascript.Any help would be appritiated
  5. Liquid

    hangman help

    System.out.println(secret.indexOf(guess));can you take the indexOf of a string with a string.in this case secret is a sting entered by the user and guess is a letter entered by a second user. i want to compare the letter to the word entered and then either print the next stage of the hangman or print the location of the letter in the word
  6. I have to build a private hangman game. Im trying to break it up into parts and the one im stuck on is taking the letter, that the second user entered as his guess and comparing it to the first users secret word string. what i have right now is all jumbled so wont make much sense.Basicly how would you go about looking in a string for a character and then if its found implement a string the draws the letter in.
×
×
  • Create New...