Jump to content

Random

Members
  • Posts

    30
  • Joined

  • Last visited

    Never

Contact Methods

  • AIM
    vWv+Random+vWv
  • MSN
    randomwebdesign@hotmail.com
  • Website URL
    http://exosys.travisbsd.no-ip.org/tory/

Profile Information

  • Gender
    Not Telling
  • Location
    Indiana

Random's Achievements

Member

Member (2/5)

0

Reputation

  1. Thanks Doc! I just checked it, and it worked like a charm
  2. It was because the variables and the $_POST variables need to be switched... ex. $fname = $_POST[\'f_name\']; thnx anyways
  3. As you can tell from my recent outbreak of posting for newbie help, I am learning MySQL. I am now having trouble with a signup form and the process script. Here they are: SIGNUP FORM: [php:1:78927ec1bf]<?php print \"<BR><BR><BR>\"; print \"<h1>Test for MySQL Tables</h1>\"; print \"<BR><BR><BR>\"; print \'<form action=\"signup_process.php\" method=\"post\">\'; print \'Desired Username: <input type=\"text\" name=\"username\" maxlength=20><BR>\'; print \'Desired Password: <input type=\"password\" name=\"password\" maxlength=20><BR>\'; print \'First Name: <input type=\"text\" name=\"f_name\" maxlength=25><BR>\'; print \'Last Name: <input type=\"text\" name=\"l_name\" maxlength=25><BR>\'; print \'Email Address: <input type=\"text\" name=\"email\" maxlength=\"60\"><BR>\'; print \'Age: <input type=\"text\" name=\"age\" maxlength=\"3\"><BR>\'; print \'Gender: Male<input type=\"radio\" name=\"male\" value=\"male\"> Female<input type=\"radio\" name=\"female\" value=\"female\"><BR>\'; print \'<input type=\"submit\" value=\"Finish signup!\">\'; ?>[/php:1:78927ec1bf] and the PROCESS SCRIPT: [php:1:78927ec1bf]<?php $dbuser = \"random\"; $dbpass = \"random\"; $dbname = \"random\"; $_POST[\'username\'] = $uname; $_POST[\'password\'] = $pword; $_POST[\'f_name\'] = $fname; $_POST[\'$l_name\'] = $lname; $_POST[\'email\'] = $email; $_POST[\'age\'] = $age; $_POST[\'gender\'] = $gender; if (empty($_POST[\'username\']) || ($_POST[\'password\']) || ($_POST[\'f_name\']) || ($_POST[\'l_name\']) || ($_POST[\'email\']) || ($_POST[\'age\']) || ($_POST[\'gender\'])) { print \"Please fill in all of the required fields!\"; }else { $link = mysql_connect(\"localhost\", $dbuser, $dbpass) or die (\"Database Error: Couldn\'t Connect!\"); mysql_select_db($dbname, $link) or die (\"Couldn\'t open $db!\"); $query = \"INSERT INTO user_info (username, password, f_name, l_name, email, age, gender) values( \'$uname\', \'$pword\', \'$fname\', \'$lname\', \'$email\', \'$age\', \'$gender\' )\"; mysql_query($query, $link) or die (\"Couldn\'t input data!\"); mysql_close($link); } ?>[/php:1:78927ec1bf] After I hit the submit button and process the form, no errors come up, so I goto my PuTTY box and get onto my database, select the columns, and they just added blank lines to it, no information what-so-ever. Help please.
  4. still didn\'t work. yeah I will wait for shiva to get on.
  5. [php:1:10dbd8e8ef]<?php $fetch = @mysql_fetch_row( $result ); ?>[/php:1:10dbd8e8ef] so it looks like that? if so that didn\'t work.
  6. I was just pointing out why it says connected that wasnt a problem hehe
  7. How do I print a row from mysql? This is the script I was trying ( newbie at this ): [php:1:71284b16c1]<?php print \"<BR><BR><BR><BR>\"; $conn = mysql_connect(\"localhost\", \"random\", \"random\") or die (\"Couldn\'t Connect...\"); print \"Connected!\"; $db = \"random\"; mysql_select_db($db, $conn) or die (\"Couldn\'t connect\"); $result = mysql_query( \"SELECT * FROM user_info \"); $fetch = mysql_fetch_row( $result ); print \" $fetch \"; mysql_close( $conn ); ?> [/php:1:71284b16c1] It prints out: \"Connected! Array\"; where Connected is from the successful connect, and I guess $result is printing Array. Any help is appreciated. Thanks.
  8. ok, i was forgetting the int line. eehhe.
  9. I am using PuTTY to access my mysql database. I want to add a table named users into it with rows named username and password. How would I write this up? I have this but there is a syntax error: mysql> CREATE TABLE users ( username VARCHAR(20), password VARCHAR(20)); thanks
  10. Is there a way to write a PHP script that I just execute that will completely remove everything from a database? Thanks.
  11. update: he told me to use localhost, and it worked to the point of no errors coming up, so I used a or die statement, and it went off. What could it be now? Localhost is right, and my names, etc. is all right. Thanks
  12. can someone explain each part of the table...example: sql = CREATE TABLE test int not null AUTO_INCREMENT, dead VARCHAR(20), live CHAR(1); or whatever, like what does the int, not null, AUTO_INCREMENT, and VARCHAR/CHAR, and the numbers in the parathesis mean? Thanks
  13. He said that the port may not be right..is that a possibility?
×
×
  • 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.