Jump to content

munchigum

New Members
  • Posts

    2
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

munchigum's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I'm trying to insert two variables into a table, but the first field always ends up empty, while the second one turns out correct. The entire script goes: <?php $id = $_POST['id']; mysql_connect("localhost", "*****", "******") or die(mysql_error()); mysql_select_db("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()); $key = rand(1,146); $x=1; while($x<95){ $result = mysql_query("SELECT * FROM Letters"); $row = mysql_fetch_array($result); $entry =$row['letters']; $queryb = "SELECT * FROM Permutations WHERE Number=$key"; $resultb = mysql_query($queryb) or die(mysql_error()); $rowb = mysql_fetch_array($resultb) or die(mysql_error()); $entryb = $rowb['Permutations']; $queryc="INSERT INTO $id(letter,code) VALUES ('$entry','$entryb')"; mysql_query($queryc)or die(mysql_error()); $x=$x+1; $key = $key+1; } ?> The column "letter" is always empty, but I'm sure that $entry has values in it! Please help, this is for a science fair project that's due in two days.
  2. Using PHP and MySQL I made a login script with two pages. But for some reason I keep getting this error: Warning: Cannot modify header information - headers already sent by (output started at /head.php:18) in index.php on line 10 Warning: Cannot modify header information - headers already sent by (output started athead.php:18) in index.php on line 11 Warning: Cannot modify header information - headers already sent by (output started athead.php:18) in index.php on line 25 Warning: Cannot modify header information - headers already sent by (output started at head.php:18) in /index.php on line 26 Does anyone know what the warning is trying to tell me? BTW All the mentioned lines are setting cookies.
×
×
  • 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.