-
Posts
2,018 -
Joined
-
Last visited
-
Days Won
1
Content Type
Profiles
Forums
Events
Everything posted by mdshare
-
merging multiple databases in 1 issue
mdshare replied to mdshare's topic in MySQL, Oracle, Postgress or other DB
Re: merging multiple databases in 1 issue point 3 in PHP fetching highest ID function highest_id ($idname,$dbname,$name) { $query="SELECT MAX(`ID_{$idname}`) FROM {$db_prefix}{$dbname}"; $result=mysql_query($query) or die( mysql_error() ); while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { while( list ($key, $value) = each($row) ) { echo "Number of $name : $value "; $number = "number"; $temp = "$dbname$number"; $$temp = $value; return $$temp; } } } $membersnumber = highest_id ("MEMBER","members","members"); Changing the auto increment ID $membersarray = array(); $query="SELECT ID_MEMBER FROM {$import_prefix}members"; $result=mysql_query($query) or die( mysql_error() ); while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { while( list ($key, $value) = each($row) ) { $membersarray[] = $value + $membersnumber; echo "Member $value adjusted "; } } function insertrows ($dbname, { $query="INSERT INTO {$db_prefix}{$dbname}"; $result=mysql_query($query) or die( mysql_error() ); while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) so a lot of work and only partially solving the problem, so I think there must be a simple way in SQL to do this -
merging multiple databases in 1 issue
mdshare posted a topic in MySQL, Oracle, Postgress or other DB
Ok I have a coding issue and don't feel to write a php function for it as I think it should be possible under SQL Data: db1 , db2, db3 2 databases that have to merge into a 3rd database So using the UNION command CREATE TABLE /*! IF NOT EXISTS */ db3 SELECT * FROM db1 UNION SELECT * FROM db2; result: works but.... double records next step.... Using the SELECT DISTINCT result: perfect... allmost it removes identicall records but does not add the auto incriment of field_ID any help would be apreciated problem case: 1. merging 2 similar databases in 1 2. deleting identicall records 3. auto increment has to follow up correctly in php point 3 can be done but I want it done in SQL thx md -
Re: 1h work to solve the dumbest error there is it all works and really, it's a easy overlooked error something to remember when discoverd another part of the code so that you see the stuff before it mysql_connect($hostname,$username,$passwd)or die("cannot connect to db:".mysql_error()); mysql_select_db($db_name) or die (mysql_error()); mysql_query("drop table village"); mysql_query(" create table village( id int primary key, name varchar(75), x int, y int, player int, points int, rank int)"); $lines = gzfile('http://www.domain.com/x/update.txt.gz', 'r'); if(!is_array($lines)) die("File could not be opened"); foreach($lines as $line) { list($id, $name,$x, $y, $player, $points, $rank) = explode(',', $line); $name = urldecode($name); $name = addslashes($name); mysql_query("INSERT INTO village SET id='$id', name='$name', x='$x', y='$y', player='$player', points='$points', rank='$rank'"); }
-
Re: sms billing isn't sms but phon billing http://www.allopass.com/index.php4?ADV=8337006 but like lostone said expensive and this is a reliable compay
-
$res = mysql_query("SELECT * FROM village"); if ($res) { while ($newarray = mysql_fetch_array($res, mysql_assoc)) { $id = $newarray['id']; $vname = $newarray['name']; $vplayer = $newarray['player']; echo "the id of the village is ".$id." its name is ".$vname." the owner is ".$vplayer." "; } } else { printf("failed: %s\n", mysql_error($mysql)); } this isn't a script of mine but we have looked 1h to find the error in this small script, the error is the famous Warning: mysql_fetch_array missing argument thingy the solution is actually very simple (deception already knows so refrain from posting please) so lets see who can find it faster than we did
-
How do I use a [code][/code] type function on a normal page?
mdshare replied to Arson's topic in Other Programming
Re: How do I use a type function on a normal page? I don't really see what the problem is, alter like deception said a phpBB/ipb/vbulletin/smf bbcode mod isn't so hard to do -
Re: Shafted by LunarPages I would say learn to code properly to use less services
-
Re: Shafted by LunarPages take a VPS still shared but you control the usage and can know where bottlenecks are
-
[Question] Servers and Queries
mdshare replied to UCC's topic in MySQL, Oracle, Postgress or other DB
Re: Question: Servers and Queries lol deception don't tell all the secrets ;) there is a nice tool called google -
Re: Shafted by LunarPages canibalstew, I personally have no complaints about lunarpages but everyone should know that they will reach a certain point that they have to move to a more expensive plan. A game is good to start on a shared server but eventually you will have to move to a dedicated. So it's always good to put a % of the revenue aside for a future upgrade. There are pobably other good hosting companies but I stick with LP.
-
Re: Shafted by LunarPages mysql_query("UPDATE userstats,userstats_tmp SET $st=$st+$gain WHERE userid=$userid",$c) or die(mysql_error()); mysql_query("UPDATE users,users_tmp SET energy=$energy,exp=exp+$exp,will=$will,money=money-$cash WHERE userid=$userid",$c) or die(mysql_error()); example of the query used for the gym the logout or session timeout session_start(); mysql_query("update users set laston = (select laston from users_tmp where userid={$_SESSION['userid']}) where userid={$_SESSION['userid']}") or die(mysql_error()); mysql_query("delete from users_tmp where userid={$_SESSION['userid']} limit 1") or die(mysql_error()); mysql_query("delete from userstats_tmp where userid={$_SESSION['userid']} limit 1") or die(mysql_error()); session_unset(); session_destroy(); so these 2 examples shows the use of temp tables + timestamp usage
-
Re: Shafted by LunarPages well bluehost just shuts your site down if you use to much services without any warning
-
Re: Shafted by LunarPages I use temp tables so basicly only a portion of the database is updated instead of a full db. easy to implement and it only uses crons on the people logged in the last 60min, timestamp updates then again the players that login
-
Re: Shafted by LunarPages I have over 100 crons on all sites (5 servers), off course I don't use the cheapiest plan a lot are just redirects from the earlier bought plans that I know use as test servers. then again you all brag that you make a ton of money, rent a dedicated. You all know from start that a shared plan is good to start but that you have to move sooner or later as your site grows
-
A question to sort out all the arguments over coding copyright.....
mdshare replied to Snatchy's topic in General Discussion
Re: A question to sort out all the arguments over coding copyright..... If you are a serious game owner, my lawyer who is based at Washinton DC wants to give free 15 min consultation time through phone about copyright, trademark etc As we are working close together he will provide CE a How To Copyright Guide -
Re: Free codes?? that's truelly bullshit as the success of mccode is due to the free code here is the link again http://www.criminalexistence.com/codes- ... 00-gnu.zip
-
Re: How do You Code Php Tables http://www.pageresource.com/html/table1.htm is basic html you mix into your php
-
Re: TC Rips exactly waffles, and I'm happy to see that more and more mccode based games starting to change... owners start to make changes etc so that their game doesn't look and feel anymore as all the rest.
-
Re: Host Change Rocky [email protected] that's our dear friend onfire, some members of CE really love him *cough* check your config files, and check if you recreated the sql db
-
Re: SQL Injection lol it's so simple to fix it .... but a hell of a lot of work
-
Re: Phone Billing not that I know of game wise, I really think phone billing is way to expensive in fees or you have to eliminate a lot of countries
-
Re: Help needed straightening out my game. Sorry to hear you got scammed wolf. To hire a coder, ask examples of their previous work etc not everyone is honest and I don't want to see someone get scammed twice Also note that a coder does not need cpanel access. Most that asks cpanel access are most likely thieves. If they claim to need sql access, you can always make a seperate user/pw for a sql db, a coder would know how to update the sql db through a script instead of phpmyadmin. If they claim to need ftp access, you can always make a seperate ftp user/pw for the portion of the site allowed. Take backups every day from your site and download them to your pc, just incase a coder screws up. (coders are lazy and hate to make a copy of a file, normally they overwrite the original file(s) ) The most expensive isn't allways the best, you can get quality work from someone who asks a lot less. So back to the top , ask examples of their work and if you can contact their clients. md
-
First experience: The phone billing gateway is super and easy to implement. Their gateway is top notch compared to other sites. If you don't want to accept c/c payments through phone billing it's easy to signup, if you want to accept c/c then you have to provide the gateway your business info. Payments and statistics are shown on the site per document (gateway option) you made, you can even link multiple sites , no need to make an extra account. Payments happen by cheque and you can request anytime a cheque. Downside: You can only use it for micro payments, fees are very high but then again it's the single trustworthy one I encounterd so far. You can select multiple countries but your revenue changes by country. For instance USA on $5 you would see $2.05 , if you offer phone billing for instance also to Hong Kong, your revenue would be $0.29. My thoughts: As we all offer in a way a product that is just 'air' to our customers I don't mind the high fees as you reach a much broader public. Then again you could do it for smaller stuff also. Towards mccode games, you could for instance award special tokens if they order through phone billing, 30 tokens would be a full DP, 10 tokens (1 call) a 7 day DP, players could save up their tokens for a full DP by calling multiple times.
-
Re: Counting (nr game) 809
-
Re: Mod ideas lets make a kind of a mod writers contest join fee $1 1 prize, which is the total of the people that joined the contest winner gets selected through a poll if there is interest for a mod contest we can start one....