Jump to content

zyra

Members
  • Posts

    14
  • Joined

  • Last visited

About zyra

  • Birthday September 11

Profile Information

  • Gender
    Female

zyra's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. That helped,and now the "code" is being filled,but not completely. The"letter" column is rows of nothing, and it gives this error: Duplicate entry ' -B6' for key 'letter'
  2. I've been trying to insert something into a table, but no matter what I do, it never works. I've been at it for hours. The whole script looks like this: $id = $_POST['id']; mysql_connect("localhost", "zyra_*****", "*******") or die(mysql_error()); mysql_select_db("zyra_sciencefair") or die(mysql_error()); mysql_query("CREATE TABLE $id ( letter varchar(1) COLLATE latin1_general_cs NOT NULL, code varchar(2) COLLATE latin1_general_cs NOT NULL, UNIQUE KEY letter (letter,code) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs") or die (mysql_error()); echo("Yes"); $query = "SELECT * FROM Letters"; $queryb = "SELECT Permutations FROM Permutations ORDER BY RAND()LIMIT 1"; $queryc="INSERT INTO `zyra_sciencefair`.$id (letter, code) VALUES ('$entry','$entryb')"; $x=1; while($x<95){ $result = mysql_query($query) or die(mysql_error()); $resultb = mysql_query($queryb) or die(mysql_error()); $row = mysql_fetch_array($result) or die(mysql_error()); $rowb = mysql_fetch_array($resultb) or die(mysql_error()); $entry = $row['letters']; $entryb = $rowb['Permutations']; mysql_query($queryc)or die(mysql_error()); $x=$x+1; } ?> I have a feeling that $entry is empty, and somehow nothing got passed down to it. And everything works fine until you get to the whiole loop. Please help!
  3. Thanks! That helped! Oh, and is "character" a key word in mySQL because it made me change it.
  4. So, I'm trying to make a code to create a table, and I'm really new to mySQL. So I used phpMyAdmin for the code, and it gave me: CREATE TABLE `$id` ( `Character` varchar(1) COLLATE latin1_general_cs NOT NULL, `Code` varchar(2) COLLATE latin1_general_cs NOT NULL, UNIQUE KEY `Character` (`Character`,`Code`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs But it didn't work right, so I tried fixing it and got: <?php mysql_connect("localhost", "zyra_*******", "*****") or die(mysql_error()); mysql_query("CREATE TABLE $id ( Letter varchar(1) COLLATE latin1_general_cs NOT NULL, Code varchar(2) COLLATE latin1_general_cs NOT NULL, UNIQUE KEY Character (Character,Code) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs") or die (mysql_error()); ?> But then it started giving me a weird error. "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 '( Character varchar(1) COLLATE latin1_general_cs NOT NULL, Code varchar(2) COLLAT' at line 1" And I have no idea what to do. Please help!
  5. Thanks! I can't believe I spent hours trying to make it work when all I needed to do was switch around a couple of variables.
  6. I am trying to make a multiple choice quiz,but for some reson it wont work. <div align="center"> <p> General Hood fought for which side in the Civil War? <form method="post" action="qtwo.php"> <p> <input type="radio" name="qone" value="1">Union<br> <input type="radio" name="qone" value="2">Rebel<br> <input type="radio" name="qone" value="3">Patriot<br> <br> <button type="submit"><img src="submit.png"></button> </form> </p> </div> and $_POST['qone'] = $qone; include ('head.php'); if ($qone == 2) {echo "<p> Your answer was correct!</p>";} else {echo "<p> Sorry, General Hood fought for the rebels or Confederates.</p>";}
  7. I keep getting a weird error like this: Warning: Cannot modify header information - headers already sent by (output started at /home/zyra/public_html/head.php:13) in /home/zyra/public_html/loginact.php on line 20 I think it has something to do with some cookies I'm working with. Any insight?
  8. I am learning MySQL, and I made a database, and added a user, but when I try to connect to MySQL it tells me access has been denied. I used this script: mysql_connect("localhost", "Zyra", "*********") or die(mysql_error()); echo "Connected to MySQL" ; Please help me figure out how to make it work!
  9. I am learning MySQL, and I made a database, and added a user, but when I try to connect to MySQL it tells me access has been denied. I used this script:Please help me figure out how to make it work!
  10. There is no meaning. Life started randomly, when some chemicals made bacteria in a pool. Life just happens.
  11. I have been trying to make a small user managment system, where you login and then you can see the rest of the site. I ave tried using If statements, but it wont work. Is it possible?
  12. Does HelioHost support ASP without the .NET, and if they only support ASP.NET, what is the difference between ASP and ASP.NET?
×
×
  • Create New...