Jump to content

Oldiesmann

Members
  • Posts

    72
  • Joined

  • Last visited

    Never

About Oldiesmann

  • Birthday 06/30/1982

Contact Methods

  • AIM
    CincyOldiesFan
  • MSN
    oldiesmann@oldiesmann.us
  • Website URL
    http://www.archiefans.com
  • Yahoo
    Oldiesmann

Profile Information

  • Gender
    Male
  • Location
    Cincinnati, Ohio

Oldiesmann's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. The only way you can do this is to put the php include inside the proper section of HTML code (I'm not real familiar with frames, so I couldn't tell you exactly how to do it).
  2. While it is possible to pull all the info in a single query, it would be a bit easier to do it in two queries, and you're still going to have to use PHP to sort all the data out... First get all the team names and find out how many games there were... Then, find the number of wins for each team Put all the wins in an array, using the team names as the keys Sort the array in reverse order (so the team with the most wins will be first) Use a foreach loop to calculate the losses for each team and display the info Basically, something like this: $query = mysql_query("SELECT home_team FROM table ORDER BY home_team ASC") or die(mysql_error()); $num_games = mysql_num_rows($query); $team_data = array(); while($teams = mysql_fetch_assoc($query)) { $current_team = $teams['home_team']; // Find all the wins... This is tricky... $query2 = mysql_query("SELECT COUNT(home_result) AS home_wins, COUNT(away_result) AS road_wins FROM table WHERE (home_team = '$current_team' AND home_result = 'Win') OR (away_team = '$current_team' AND away_result = 'Win') or die(mysql_error()); // Calculate the wins $wins = mysql_result($query2, 0, 0) + mysql_result($query2, 0, 1); // Now that we have this info... $team_data[$current_team] = $wins; } arsort($team_data); foreach($team_data AS $name => $games_won) { // Figure out how many games they lost $games_lost = $num_games - $games_won; // Put whatever code you want here to output this info... } There might be a way to do all that in one query, but it's easier to do it in two queries.
  3. You have a typo in your code - $sq1 instead of $sql
  4. You might also find the Information Schema helpful
  5. Your best option would be to use CSS. See http://www.w3schools.com/css/css_border.asp for more info.
  6. To communicate between the two, you will need to use either a third-party database class (such as ADODB) or one of the PHP extensions that supports both Access and MySQL (such as ODBC or PDO). I'm not real sure how you connect to Access databases from PHP, but basically what you'll need to do is this: Pull the data from MySQL into PHP variables Pass the data (using those variables) to Access after modifying it (if needed). I honestly don't understand why this is necessary - I realize that Access isn't really designed for web databases, but why do you need both Access and MySQL? Also, Microsoft Excel will open CSV files, so that might be an easier way to do things.
  7. "spleblem_games3.categories" means it's trying to look for a "categories" table in the "spleblem_games3" database. Can you post the code you're using?
  8. I don't think having 24 columns vs 24 rows would make much of a difference in terms of table size (you're still storing the same data). However, I would recommend doing one row per hour rather than one row per day. 24 columns would make things really confusing, and you'd need other columns besides one for each hour (one to uniquely identify each row, one to keep track of which day it was, etc.).
  9. Make sure you're either replacing the line breaks with <br /> (PHP's nl2br() function will do this), or that you're using double quotes around the value: echo '\n'; - literally displays \n echo "\n"; - outputs a linebreak
  10. PHP needs to be compiled with "--with-pgsql" for pg_connect() (and other PostgreSQL functions) to work. Either your host doesn't support PostgreSQL, or they forgot to compile PHP with PostgreSQL support (in which case they should be willing to recompile PHP to fix this issue).
  11. I would suggest having a couple additional tables: Customers - A table containing information about all your car owners: Customer_ID First_Name Last_Name Address City State Zip Home_Phone Work_Phone Other_Phone Cars - A table containing information about all the cars: Car_ID Customer_ID Year Make Model Color Then, modify your logs table like this: ID Customer_ID Car_ID Service_desc Date_service Or, if you'd like to take it one step further, come up with a list of unique service codes (short text strings that uniquely identify each service) and add a services table: ID_Service Service_Code Service_Desc Then you could replace "service_desc" with "Service_code" and have even less info. This will help you minimize the duplicate info stored in particular tables, while increasing flexibility.
  12. Googling for "mysql visual basic vista" (without the quotes): http://www.codeproject.com/useritems/VBnet_to_mySQL_Server.asp
  13. No matter what you do, there will always be a way around it, and it will only annoy and frustrate your users.
  14. The conditionals were invented by Microsoft, and therefore will only work for Internet Explorer. You will need to check the user agent string to handle other browsers.
×
×
  • 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.