
redarrow
Members-
Posts
7,306 -
Joined
-
Last visited
Everything posted by redarrow
-
what the database look like please. id userid stats date ip
-
It not the code no way. is the code includded to the members page where they login? all the big programmers getting up know so us uk wannabe can sleep lol
-
sorry i added a dollor sign. dam you lot so fast so sorry. change the colum to a (int) in the database
-
You need the id off the user, in every table, to get that user's info out. that it? long_user_name. id <<<< table id ((auto_increment)) userid <<< users id ((varchar)) username ((varchar)) surname ((varchar)) dob ((varchar)) your EVENTS TABLE clientid is suppose to be userid your getting confused mate.....
-
SET visits = $visits+1 udates a table plus 1 via there id.
-
user userid username tel note user_info id userid username tel note primary_key just the field id, in this case, and the userid was from the user's primary id, that why we can see everthink, useing the user's id, in both tables. do you get it....
-
This will insert, my god please! lets all php pray <?php $query = "INSERT INTO 'TABLE_NAME' (handle, email, userLevel, password, banned, dateJoined, validated, validtionCode) VALUES ('".$properties['username']."','".$properties['email']."','$userLevel','".$properties['password']."',0,'$time','$validated','$validationCode')"; ?>
-
look fishy i agree, does it get any info in the database yet? <?php $query = "INSERT INTO 'TABLE_NAME' (handle, email, userLevel, password, banned, dateJoined, validated, validtionCode) VALUES ('$properties[username]','$properties[email]','$userLevel','$properties[password]',0,'$time','$validated','$validationCode')"; ?> try this way? <?php $query = "INSERT INTO 'TABLE_NAME' (handle, email, userLevel, password, banned, dateJoined, validated, validtionCode) VALUES ('".$properties[username]."','".$properties[email]."','$userLevel','".$properties[password]."',0,'$time','$validated','$validationCode')";
-
try this form and give post redults, you ned to realy learn to tidy your code up, it bad very bad i broke a finger nail <form action="train2.php" method="POST"> <tr> <td colspan="4"> <center> <img src="pic/toppage16.gif" /> </center> </td> </tr> <tr> <td> <font color="white"> Reassign Miners </font> </td> <td align="right"><font color="white">0 Naquadah</font></td> <td align="middle"> <font color="white"> <input size="6" maxlength="8" value="0" name="miner"> </font> </td> </tr> <tr> <tr> <font color="white"> Reassign Normal Attackers </font> </td> <td align="right"> <font color="white"> 0 Naquadah </font> </td> <td align="middle"> <font color="white"> <input size="6" maxlength="8" value="0" name="atsold"> </font> </td> </tr> <tr> <td> <font color="white"> Reassign Normal Defenders </font> </td> <td align="right"><font color="white">0 Naquadah</font></td> <td align="middle"><font color="white"> <input size="6" maxlength="8" value="0" name="defsold"></font></td> </tr> <tr> <td><font color="white">Reassign Covert Agents</font></td> <td align="right"><font color="white">0 Naquadah</font></td> <td align="middle"><font color="white"> <input size="6" maxlength="8" value="0" name="spy"></font></td> </tr> <tr> <td><font color="white">Anti Covert Agents</font></td> <td align="right"> <font color="white"> 0 Naquadah </font> </td> <td align="middle"> <font color="white"> <input size="6" maxlength="8" value="0" name="spykiller"></font></td></tr> <tr> <td align="middle" colspan="3"> <font color="white"> <input type="submit" value="UnTrain!" name="untrain"> </font> </td> </form>
-
where the form, The 0 mean no post, The 1 means posted!
-
Somethink like this ..... i am no good with javascript, so someone elese have to help sorry <script type="text/javascript"> <!-- function save(){ str = document.forms[0].t1.value; mydoc = document.open(); mydoc.write(str); mydoc.execCommand("saveAs",true,".txt"); mydoc.close(); return false; } //--> </script> </head> <body class="body"> <form id="form1" action="" onsubmit=""> <input type="text" name="t1"/> <input type="button" value="process" onclick="save()"/> </form>
-
how can i limit the amount of queries returned?
redarrow replied to mattsolomon's topic in PHP Coding Help
SELECT * FROM `your_table` LIMIT 0, 3 -
failed to open stream: No such file or directory in
redarrow replied to ketchumdev's topic in PHP Coding Help
sorry mate thort you was dong all this at home so sorry. This would help, but you can not find the home page. <?php echo $_SERVER['PHP_SELF']; ?> Surly the web company, you got going there, can help email them? Didnt you get any intuduction, papers emails?. -
As david said this i fell of my seat lol. Well spotted 10/10 cheared me up mate
-
i got it from here, remember you work with them or us helping you they wrote it ok. there a download page aswell ok. http://davidwalsh.name/backup-mysql-database-php sorry not tested it only read the comments.
-
well spotted, you need iframe well done above.
-
Insert into multiple tables linked by foreign keys (PHP, MySQL)
redarrow replied to endouken's topic in PHP Coding Help
you got to inprove it yes maybe a duplication but i dont think so really, but there loads you can do, all i done was open your abiltys, to look deeper and think more. you can get the dob date of birth use two last digets, and home adress ,loads think think think, im going mad lol -
even better, sends the lot, to the user to there email adress http://www.sematopia.com/2006/02/how-to-backup-mysql-database-email-results-using-php/ you download this as help code, not tested via me google helped.
-
The rest is easy you do the rest, yes a example from google i like to rest. Here a good example try it. Alter the way you need it. <?php backup_tables('localhost','username','password','blog'); /* backup the db OR just a table */ function backup_tables($host,$user,$pass,$name,$tables = '*') { $link = mysql_connect($host,$user,$pass); mysql_select_db($name,$link); //get all of the tables if($tables == '*') { $tables = array(); $result = mysql_query('SHOW TABLES'); while($row = mysql_fetch_row($result)) { $tables[] = $row[0]; } } else { $tables = is_array($tables) ? $tables : explode(',',$tables); } //cycle through foreach($tables as $table) { $result = mysql_query('SELECT * FROM '.$table); $num_fields = mysql_num_fields($result); $return.= 'DROP TABLE '.$table.';'; $row2 = mysql_fetch_row(mysql_query('SHOW CREATE TABLE '.$table)); $return.= "\n\n".$row2[1].";\n\n"; for ($i = 0; $i < $num_fields; $i++) { while($row = mysql_fetch_row($result)) { $return.= 'INSERT INTO '.$table.' VALUES('; for($j=0; $j<$num_fields; $j++) { $row[$j] = addslashes($row[$j]); $row[$j] = ereg_replace("\n","\\n",$row[$j]); if (isset($row[$j])) { $return.= '"'.$row[$j].'"' ; } else { $return.= '""'; } if ($j<($num_fields-1)) { $return.= ','; } } $return.= ");\n"; } } $return.="\n\n\n"; } //save file $handle = fopen('db-backup-'.time().'-'.(md5(implode(',',$tables))).'.sql','w+'); fwrite($handle,$return); fclose($handle); } ?>
-
failed to open stream: No such file or directory in
redarrow replied to ketchumdev's topic in PHP Coding Help
When you go localhost, in the browser should see the XAMPP stuff.... If you then goto the www directory, your see php files there, add yours then do it agin with the new file name. localhost/what_ever.php should see your php page... -
Insert into multiple tables linked by foreign keys (PHP, MySQL)
redarrow replied to endouken's topic in PHP Coding Help
This will create 6 numbers for a user for there secuity id. <?php /** * @author * @copyright 2011 */ $number=rand(000000,999999); echo $number; ?> You can make this more secure. -
Insert into multiple tables linked by foreign keys (PHP, MySQL)
redarrow replied to endouken's topic in PHP Coding Help
Yes mate from 5.0 or above. Lets both work this out ... If you use auto increment for a table, you get a automatic number that true. The number you get is the first number on mysql, they all call that the primarry_key, now if i set a colum to a varchar, i can add loads of more numbers, if i make a rand number, of 6 numbers long insert it into that varchar we just made, we got another unique key for that user. we can play all day like this we can even use letters and unusauall names. select users from accounts where id="000001" AND secuity_number="000012"; were getting a person with the id of 000001 and secuity number of 000012 this is better then all them foregn keys lol only my opionion i use this method on all my servers that link from one server to another, all over the place as my project on the web grows. i also SALT and md5 my numbers away from prying eyes. -
Initializing same large array for many web pages
redarrow replied to mintbox's topic in PHP Coding Help
The best way is to sort out the array, the way you want it, then re submit it in a database in the correct usable order you want it displayed. should be fun. ps.this time update the database correctly, in the correct order as needed. there are some amazing ppl on php freaks, that can re write the whole database logic but i dont see them. -
You can get anythink you want, as it all in a database. I looked at your code and was baffled at all the insucure programming. maybe your self tualt, but you need a good tutoral,sorry but none off the var are protected for fake inserts from ppl. look at this. select what_ever from what_ever where id="what_ever" that easy.
-
Insert into multiple tables linked by foreign keys (PHP, MySQL)
redarrow replied to endouken's topic in PHP Coding Help
php has foreign keys but from 5.0 more info link. http://www.techrepublic.com/article/an-introduction-to-foreign-keys-and-referential-integrity-in-mysql/6035435 what been said and posted is better thu