Jump to content

ataria

Members
  • Posts

    179
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

ataria's Achievements

Member

Member (2/5)

0

Reputation

  1. I got it :) thanks for the help guys.
  2. Alright. bout it inserting 2 rows, i just deleted that script. I put it on the reigster page, and, it's ... [code] $insertchar = "INSERT INTO `characters` ( `username` ) VALUES ('$username')";[/code] and, then, i looked in the DB, and it's under 'int' so i changed it to text.. now it won't insert, anyone see the problem?
  3. It shows... "rows inserted so far: 1" then my crap on the page. any way to hide that?
  4. WOW. It only did one row.. but, it made the page go white :(
  5. Alright. the page is supposed to be.. 'If user has a character (charid=1), display the stats. (didn't get that far), else, automatically create one, then change the 'charid to 1', (didn't get that far, b//c it would be annoying to have to keep changing the charid to '0' to do tests).. and, since the character won't create properly, it's messing me up... big time. ---- I changed it to the code you just posted, and, it didn't even create a row.
  6. Here is the code as it stands right now.. [code] <?php include ("global.php"); $chari = @mysql_num_rows(mysql_query("SELECT * FROM `users` WHERE `charid`")); if ($chari == 1) { echo "TEST."; } else { $sql = mysql_query("INSERT INTO `characters` ( `username` ) VALUES ('{$_SERVER['PHP_SELF']}".time()."')"); echo "<center> <table cellspacing=3 cellpadding=3 width=300> <tr> <td class=bar colspan=2><center> <font class=white><b>Uh-Oh</b></font></center> </td> </tr> <tr> <td> You don't have a character! In order to play the site, you need one... so, we gave you one! <br><br> <img src=> <br> <br> This is your <b>one</b> and <b>only</b> character. You will be able to make it go to school and become smarter, get it a job, change it's appearance, and, much more! Remember; treat it as you treat yourself, hence, lay off the drugs... <br><br><br><br><br><br><br><br> </td> </tr> </table> </center> "; } ?> <link rel="stylesheet" type="text/css" href="mystyle.css" /> [/code]
  7. Well... they show a '0'. (your insert) I am gonna try something.. here it what i am gonna do. (the site is measured in days...) in the global, i have the time thing which is... [code]$time = time(); $day = date("z", $time) -252; [/code] and, i'm gonna make it insert the day... alright. it just inserted the same day. (31)
  8. they don't show up.. and, i added ');' to the end to make it work...
  9. About the 'where' thing.. the charid, is only 0 or 1.. so, if it equals 1 it shows test.. if it equals 0, it shows the else.. it works... (yes, i jsut did a test) -- the query is not run elsewhere... =/
  10. yeah. but, i just want to retrieve /that/ information. I'm not trying to make it equal anything.
  11. the code is.. [code]<?php include ("global.php"); $chari = @mysql_num_rows(mysql_query("SELECT * FROM `users` WHERE `charid`")); if ($chari == 1) { echo "TEST."; } else { $sql = @mysql_query("INSERT INTO `characters` ( `id`, `username` ) VALUES ('', '{$_COOKIE['uid']}')" ); echo "<center> <table cellspacing=3 cellpadding=3 width=300> <tr> <td class=bar colspan=2><center> <font class=white><b>Uh-Oh</b></font></center> </td> </tr> <tr> <td> You don't have a character! In order to play the site, you need one... so, we gave you one! <br><br> <img src=> <br> <br> This is your <b>one</b> and <b>only</b> character. You will be able to make it go to school and become smarter, get it a job, change it's appearance, and, much more! Remember; treat it as you treat yourself, hence, lay off the drugs... <br><br><br><br><br><br><br><br> </td> </tr> </table> </center> "; } ?> <link rel="stylesheet" type="text/css" href="mystyle.css" /> [/code] it inserts 2 rows.. When i limit it to '1', it doesn't insert a row... help!!! *global connects to the DB.
×
×
  • 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.