Jump to content

beennn

Members
  • Posts

    117
  • Joined

  • Last visited

Everything posted by beennn

  1. How can I check a row for a number and then based on the result, perform an insert if the number isn't found? I need to ensure only one of a particular number is found in the row.
  2. I've set up highscores for a game i'm working on, though im faced with an issue when two people get the same score. I want the player who achieved the score first to be at the top of the leader boards. Does anyone have any suggestions on how I can achieve this? Any help or pointers would be great, and sorry if this isn't the correct place to be asking.
  3. How can I stop the padding on a div from stacking? By this I mean, I have several of the same div next to one another with a padding of 30px, as the divs are placed next to each other, this gives a gap of 60px between them, and only a gap of 30px between other elements. How can I make sure only 30px is on each side and stop there padding from stacking?
  4. I'm having some trouble putting a php array into a javascript array, here's what I have: <?php $table = array(); while($d = mysql_fetch_array($sDP)) {$table[] = $d; } ?> <script Language="JavaScript"> var description = new Array; <?php for($i=0; $i < 7; $i++) { echo "description[$i]='".$table[$i]."';\n";} ?> for(i = 0; i < 7; i++){ document.write(description[i]) } </SCRIPT> However document.write gives out "Array", though I'm not sure where it's coming from. I know it's not coming from my database, so there must be something wrong with the way I'm assigning the array?
  5. Aha! Thank you very much, it was
  6. $Email is just letters, no symbols. It's not actually an email address, for testing, $Email's value is "Test" in the database. It only just crossed my mind to try it with "Test" instead of $Email, which does work. I know $Email is holding "Test", so is "SELECT * FROM $Email" the wrong way to write it?
  7. At the top of my file I have: session_start();$Email = $_SESSION['email_address']; mysql_connect ("localhost","root" ,"####") or die ('error: ' . mysql_error()); mysql_select_db ("accounts"); $selectProject = mysql_query("SELECT * FROM $Email") or die(mysql_error()); while($row = mysql_fetch_array($selectProject)) { $Name = $row ['Name']; } Further down the file I'm trying to echo $Name, but nothings appearing, and I'm not getting any errors <?php echo ($Name); ?> Any idea where I'm going wrong?
  8. Oh ok, thank you both. I would have posted but im not using html for posting lol. In the process of setting up a login checker inside of unity. Wanted to know where I was going wrong, looks like i've gone wrong in unity. Thanks for the help
  9. Oh ok, so the scripts fine just there cant be a difference between method of posting? The alternative to $_POST['username']; would be $_POST["username"]; ?
  10. Could use a hand finding what i've done wrong in this script Script: <?phpmysql_connect('####', '####', '####') or die('Could not connect: ' . mysql_error());mysql_select_db('####') or die('Could not select database'); $username = $_POST['username'];$password = $_POST['password'];$sql="SELECT * FROM 'accounts' WHERE username='$username' and password='$password'";$result=mysql_query($sql); $count=mysql_num_rows($result); if($count==1){ echo "Login successful"; } else { echo "Login failed"; }?> Error: ( ! ) Notice: Undefined index: username in C:\wamp\www\_#\display.php on line 5Call Stack# Time Memory Function Location1 0.0003 676216 {main}( ) ..\display.php:0( ! ) Notice: Undefined index: password in C:\wamp\www\_#\display.php on line 6Call Stack# Time Memory Function Location1 0.0003 676216 {main}( ) ..\display.php:0( ! ) Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\wamp\www\_#\display.php on line 11Call Stack# Time Memory Function Location1 0.0003 676216 {main}( ) ..\display.php:02 0.0116 683696 mysql_num_rows ( ) ..\display.php:11Login failed
×
×
  • Create New...