just me and php Posted November 1, 2006 Share Posted November 1, 2006 [code] switch( $tableselect ) { case "ABC": $tablename = "TB1"; break; case "DEF": $tablename = "TB2"; break; case "123": $tablename = "TB3"; break; case "456": $tablename = "TB4"; break; default: die("Invalid Table Selected."); break; } if( $tableselect == "ABC" || $tableselect == "123" ) {//If this is a HotLap Record, we store this information $fields = "Username, track, HL_F, HL_MS, online, disp, PCLabel, PCValid, PC, date, display, hacked, MP, os"; $values = "'$username', '$track', '$time_f', '$time_ms', '$online', '$disp', '$PCLabel', '$PCValid', '$PC', '$date', '$display', '$hacked', '$MP', '$os'"; } else {//And if this is a Total Race Time Record, we store this information $fields = "Username, track, TRT_F, TRT_MS, online, disp, date, display, hacked, MP, os"; $values = "'$username', '$track', '$time_f', '$time_ms', '$online', '$disp', '$date', '$display', '$hacked', '$MP', '$os'"; } $query = 'INSERT INTO ' . $tablename . ' (' . $fields . ') VALUES (' . $values . ')'; //echo $query . "<br />";[/code]This inserts data into my data base and works great but i need it to look at data base for[code]$fields = "Username, track, HL_F, HL_MS, online, disp, PCLabel, PCValid, PC, date, display, hacked, MP, os";[/code]First and over right if (HL_F, HL_MS,)Are a smaller numbers ( faster Times )Can someone help me with codethanks inavance ;) Link to comment https://forums.phpfreaks.com/topic/25828-help-looking-and-overright-data-base/ Share on other sites More sharing options...
trq Posted November 1, 2006 Share Posted November 1, 2006 You'll need to be alot clearer in your explination. Link to comment https://forums.phpfreaks.com/topic/25828-help-looking-and-overright-data-base/#findComment-117941 Share on other sites More sharing options...
just me and php Posted November 1, 2006 Author Share Posted November 1, 2006 Sorry il try to make this clearer the code at top is php and it inserts data into mysql database from a exe file that users have on there computers for racing game. So i guess you would call it and interface code between users computers and database.The code works great for inserting data , the problem is it inserts all the data every time user post new times (HL_F, HL_MS,)on same track(track) , I need the code above to look at data base and see that the new time (HL_F, HL_MS,)on the same track(track) and same user(username) is faster or slower if slower no post new data if faster it over rights the data.faster times would be smaller numbers in(HL_F, HL_MS,)or slower times would be biger numbers in (HL_F, HL_MS,)hope this this clearer Link to comment https://forums.phpfreaks.com/topic/25828-help-looking-and-overright-data-base/#findComment-117961 Share on other sites More sharing options...
just me and php Posted November 1, 2006 Author Share Posted November 1, 2006 Is this clear or do you need more explination, if so ask me something about it , then maybe il know how to explane it better.thanks Link to comment https://forums.phpfreaks.com/topic/25828-help-looking-and-overright-data-base/#findComment-118131 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.