-
Posts
206 -
Joined
-
Last visited
Never
Everything posted by Jiraiya
-
i was hoping this would do it $username = $_COOKIE['ID_my_site']; username = persons user name
-
yes just for one user
-
that code that you posted didnt do anything
-
1. yes i did mean name=pic 2. im trying to update the pic variable in my database with the text submitted in the form above
-
I need help creating this php updating form its supposed to update a pic url with a new one that is submitted by a html form i what i have is shown below <form> Picture URL: <input type="text" pic="pic" /> <input type="submit" value="Submit" /> </form> <br /> </form> <?php $username = $_COOKIE['ID_my_site']; mysql_connect("mysql", "username", "password") or die(mysql_error()); mysql_select_db("members") or die(mysql_error()); $sql = mysql_query("UPDATE users SET `pic` = name") or die(mysql_error()); ?>
-
how would that be written like this? if ($row['potions'] >= 1 && $row['gold']>=1)
-
i was wondering about "IF" statements if i could have multiple requirements for the if statement?
-
i do know the basics the thing im really not sure is how to substitute the variable with one choosen by a user
-
I need to know how to create a math system that pulls variables from a table that are selected im trying to create a program to do math with variables that are choosen by the user for example if i were to use a fighitng game it would be like Player 1 options Health (variable) is 25 punch(variable) is 10 kick 5 i need to make it so that the user picks the variable from a list and then the the variable that they pick is put into a equation with the only thing changing in the equation is the variable choose by the user
-
what should the url be stored as in the database a char??
-
im trying to display a image that is stored as a url in my database how would i retreive the image url in the database but have it show the image??
-
im trying to set the random number that is generated to be set as the value of variable "number"
-
here is the code it displays a random number but doesn't update the variable $username = $_COOKIE['ID_my_site']; $sql = mysql_query("SELECT * FROM users WHERE username = '$username'") or die(mysql_error()); echo (rand(1,10)); $var = rand(1, 10); $sql = "SELECT * FROM users WHERE number = '$var'"; mysql_query($sql) or die(mysql_error()); ?>
-
yea kinda i have the variable set to "0" on default so i guess it would be an update mabey?
-
i have a script that generates a random number <?php echo (rand(1,10)); ?> my question is how do i set a mysql variable to equal that random number all in one script?
-
how would i make it so a random number is picked and then stored all in the same script?
-
no i dont want random numbers i want random words from a list i create and then have a set percentage that that word will be chosen
-
so i have to make a different database that contains the words? then how would i make a percent chance that a word will be choosen to be placed into the users variable when they sign up since i dont want the user to pick it?
-
i was wondering how would i make it so a random word from a list would be put into a database table when they sign up for my site? so in other words i want to have a random word to be set as one of the users variables when they sign up and i want to have it so that each word has a preset percentage of that word being picked for the database.
-
i dont understand what you mean
-
i want to add a timer to a script of mine so that after the script has run the user will have to wait 10 even if the user leaves that page so how would i do this?
-
ok it now displays "You have bought one health potion." but its not updating the database Code: [select] $sql = mysql_query("SELECT * FROM `users` WHERE `username` = '$username'"); $row = mysql_fetch_array($sql); if ($row['gold'] >= 100) { $sql = ("UPDATE users SET `gold` = `gold`-100, `potions` = `potions`+ 1 WHERE `username` = '$username'") or die(mysql_error()); echo "<center>You have bought one health potion.</center>"; }else{ echo "<center>You don't have enough gold. Come back when you getmore.</center>"; }
-
ok it now displays "You have bought one health potion." but its not updating the database $sql = mysql_query("SELECT * FROM `users` WHERE `username` = '$username'"); $row = mysql_fetch_array($sql); if ($row['gold'] >= 100) { $sql = ("UPDATE users SET `gold` = `gold`-100, `potions` = `potions`+ 1 WHERE `username` = '$username'") or die(mysql_error()); echo "<center>You have bought one health potion.</center>"; }else{ echo "<center>You don't have enough gold. Come back when you getmore.</center>"; }
-
No rows were returned by the SQL. Username entered was is what it displayed