Jump to content

twilitegxa

Members
  • Posts

    1,020
  • Joined

  • Last visited

Everything posted by twilitegxa

  1. I have a field set to TIMESTAMP in my table and have it set to ON UPDATE CURRENT_TIMESTAMP for the attribute and CURRENT_TIMESTAMP for the default, but everytime I submit the form (it's a guestbook form), I want it to automatically enter inot my database what time the post was submitted, but right now all it is submitting is zeros. Can anyone tell me what I'm doing wrong? I'm using a bundled program named WampServer, if anyone's familiar.
  2. My username was kind of a joint effort. My friend was into animation and wanted to re-do the My Little Ponies series, and we were all in high school, so everyone in our little group had nicknames, and one of my nicknames happened to be Twilight, from the My Little Ponies series. The name of the company he wanted to start was caled Gate X Animation, or GXA for short. I came up with the name when I was trying to choose a username for AOL, and it wouldn't allow enough characters for TwiLightGXA, which is how I wanted it to display, so I tried TwiLiteGXA, and it worked. And that's where my name came from! :)
  3. I'm not using a query. It's kind of a built-in feature of the program I'm using. It has an import option. The program is WampServer. I didn't know I could use a query to do it. Can anyone help e out with how to do the query? It might be easier that way possibly. I am still very new to MySQL and PHP.
  4. I tried changing the extention, but I still recived an error about the syntax. I have each field like: "field1","field2","field3"....and so on. Is this right? Maybe the character set is wrong for some reason? When I import, it is set to utf8. I tried saving it with the same character set, but it's still not working. This is the error I receive: #1064 - 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 '"Sailor Moon","Serena Tsukino","Purity And The Soul","13","06","30","1978","4","' at line 1
  5. How do I need to set up the records in the text file in order to import the records into my MySQL database? I am using MySQL 5.0.51b and I currently have a text file saved with each field separated by a comma and this was able to be imported by Microsoft Access in this format, but is not accepted by MySQL. What format do I need to put my records in for the text file to be imported into the MySQL database? I am running a program call WampServer, if that helps.
  6. I'm using a bundled pack called WampServer, that includes PHP and MySQL and I think Apache, too and configures everything for you upon installation, but when I tried running this form: <html> <body><form action="insert.php" method="post"> Identity: <input type="text" name="identity" /> Character Name: <input type="text" name="charactername" /> Element Of Influence: <input type="text" name="elementofinfluence" /> <input type="submit" /> </form></body> </html> With this PHP file: <?php $con = mysql_connect("localhost","root","password"); if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db("smrpg", $con);$sql="INSERT INTO scout (identity, charactername, elementofinfluence) VALUES ('$_POST[identity]','$_POST[charactername]','$_POST[elementofinflu ence]')";if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "1 record added";mysql_close($con) ?> I receive this error: Fatal error: Call to undefined function mysql_connect() in C:\Documents and Settings\Liz\Desktop\Sailor Moon\insert.php on line 2 Can anyone help me out to figure out what's wrong?
  7. Do you enable it by deleting the ; in front of that extension?
  8. The code you gave me didn't work, but I probably didn't do it right. I just looked up a code real quick for connecting and used this code and just changed my username and password: <?php $username = "pee_wee"; $password = "let_me_in"; $hostname = "localhost"; $dbh = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL"); print "Connected to MySQL<br>"; // you're going to do lots more here soon mysql_close($dbh); ?> But I received this error: Fatal error: Call to undefined function mysql_connect() in C:\Documents and Settings\Liz\Desktop\Sailor Moon\testpage.php on line 5 Do you know what I am doing wrong?
  9. So I need to uninstall all of the MySQL stuff? The Server, Administrator, and the Connector? And how would I disable the port 80 in Skype's settings?
  10. Can you give me a sample PHP nd MySQl script to try real quick to see if I can get connected? I just changed my ODBC to MySQL again and tested the connection in there and it says it connected, so I will try with PHP and see what happens this time, but it wouldn't work before.
  11. I'm on Windows XP Home, but on a Mac (using BootCamp). I didn't know if being on a Mac could be a problem, so I thought I 'd mention it. I have the MySQL Server 5.0 installed, and MySQL Adminstrator, and I installed the the Connector/ODBC 5.1 and I can get connected just fine through everything on my machine by using the Administrator or Server for MySQL, but when I try to use a PHP page to connect, I always get an error. I can't figure out what I'm doing wrong. Something must be installed wrong or something.
  12. Well, I wanted to use PHP with MySQL, but for some reason I can't get it to connect with PHP on my computer or server, so I gave up for now and started trying with Access so I could at least get started on what I wanted to do. I might have to change everything later to MySQL, which I know will absolutely suck! So, I can just have the PHP code that enters the information to the database on the same page as the HTML form? I thought it would need to be separate so that when the form was submitted it used the PHP as the action of how to post the information.
  13. Okay, now I am trying to write the PHP page that actually sends the data to the database, but I can't get it to work properly. I tried following a tutorial, and it sneds the form, but doesn't actually add any data to the database, just a blank record. What code do I need to get started for the PHP page that would send the data to the database? Here is part of my form and tell me if this is right as well (I just borrowed the tutorial code and updated it to reflect my form data): <?php function HTML_Head() { echo " <HTML><HEAD> <TITLE>Processing Form</TITLE> </HEAD> <BODY BGCOLOR=\"#D5D5AB\">"; } function HTML_Form() { echo " <FORM NAME = \"AccessInterface\" METHOD=post ACTION=\"DataAccess.php\"> Please enter the details you wish to be inserted into the Access Database.<br> Identity:<input name=\"identity\" TYPE=\"text\" SIZE=\"25\"><br> Character Name:<input name=\"charactername\" TYPE=\"text\" SIZE=\"25\"><br> Element Of Influence: <input name=\"elementofinfluence\" TYPE=\"text\" SIZE=\"25\"><br> <INPUT type=\"Submit\"> </form> "; } function HTML_Existing() { echo "Existing database entries"; } function HTML_Foot() { echo "</body></html>"; } HTML_Head(); HTML_Form(); HTML_Existing(); HTML_Foot(); ?> I don't know what code I actually need from the above example, other than the form itself, but I mean I know I don't need the part that is supposed to show the existing database entries, but when I try to remove that line of code, I get an error. Can someone help me with this,too?
  14. I have this code: $birthdateday=odbc_result($rs,"birthdateday"); $birthdatemonth=odbc_result($rs,"birthdatemonth"); $birthdateyear=odbc_result($rs,"birthdateyear"); $birthdate = $birthdatemonth."-".$birthdateday."-".$birthdateyear; And I want the birthdateday and birthdatemonth to display with I guess it's called leading zeros (January displays as 01 and not just 1). How do I alter this code? The other codes will just set the current time and date it looks like. My other question was, if I am using my other databse that is set for the guestbook, I have name, email, url, and comments, but I also want to display the time they submitted their comment. Will I need to have a code on the page they submit the comment that stores the current date and time into my database? If, so how would I do that? or is there another way to display this information?
  15. How can I make the month or day appear as two digits, as in January appears as 01 instead of just 1? Also, I have another database that is for a guestbook, and I want to include on the page that displays the contents of the database the time and date of when the person lef the comment. How can I do this? Does it need to be brought from the page they submit the comment that puts it into the database? Or do I do it some other way? I have also done with my MySQL before, but don't remember how it was done. Plus, someone actually wrote the script for me, so I really didn't know how they did it anyway.
  16. I just tried to load it the same way I would any other HTML file: <head> <link href="main.css" rel="stylesheet" type="text/css" /> </head> Since I have the PHP page in a table, could I not just have the CSS affect the td tag like this: td {color: rgb(53, 115, 141);} Or would I have to do it another way? I even have tried adding a paragraph tag and it wouldn't work either when I added a paragraph to my PHP page before the PHP code.
  17. I am using PHP to connect to Microsoft Access and I can't figure how to do two things: First, I want to add three parts to a variable that will be pulled from my database: birthdatemonth, birthdateday, and birthdateyear So that they all display together as one date, like 12-05-1982, under one variable, $birthdate, but I can't figure out how to do this, but I know it can be done. I have had some help with PHP and MySQL from a friend in the past, and so I'm sure it can be done. Does anyone know how? My variable looks like this: $birthdate=odbc_result($rs,"birthdatemonth"); and would diaply like this: echo "<tr><td>Birthdate</td>"; echo "<td>$birthdate</td></tr>"; Can anyone help me out with this? Second, I want to use CSS with my PHP page, but for some reason I cannot link to it, or use any internal or embedded CSS either. Can this be done? I have an external CSS set up that I would prefer to use, but if I can't then I can embed or use internal CSS if I have to to, I just need to know if it an be done and how. Can anyone help me out? I really appreciate in advance any help with these two questions. Thanks!
×
×
  • 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.