Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

optimus

Members
  • Joined

  • Last visited

  1.    risotto reacted to a post in a topic: Embedding YouTube
  2. Don't know about the Wimpy player, but have you considered this option?
  3. optimus replied to risotto's topic in Frontend
    Have you specified width and height for div that video is in? This should help keep the dimensions of page in tact.
  4. optimus replied to Mesa's topic in Frontend
    Found this link which helps explain difference between @import and linking in head.
  5. Can we have some code to troubleshoot?
  6. Bounce rate is the rate at which users exit your site. So for a particular page, if bounce rate is 10%, that means 10% of your visitors left your site after viewing the page, while 90% viewed other pages on your site. Page views are total number of pages viewed. Here are some links that might help: http://services.google.com/analytics/breeze/en/interpreting_reports_visits/index.html http://services.google.com/analytics/breeze/en/interpreting_reports_guidelines/index.html
  7. optimus replied to matthewjames28's topic in Frontend
    If you want to post some of your code, and express what your goal is, I'm sure someone will be willing to help out.
  8. I have a mysql_fetch_array result that produces 120 or so rows. To help make the resulting table more readable, I would like to insert a <hr>, or some graphic, after every 6th row of the resulting table. Any ideas how to do so? Here's the code I've got for the mysql_fetch_array. echo '<table class="db_t_res">\n'; if($result) { while($row = mysql_fetch_array($result)) { echo '<tr>\n <td style="width:10%;">'. echo $row['year']; echo '</td>\n <td style="width:30%;">'; echo $row['industry']; echo '</td>\n <td style="width:60%;">'; echo $row['emissions']; echo '</td>\n </tr>\n'; } } echo '</table>\n'; Which produces this result: Year Industry MMTCO2 Emissions 1990 All 95.36 1990 Commercial 4.34 1990 Electric 23.08 1990 Industry 19.94 1990 Residential 6.50 1990 Transportation 41.50 1991 All 96.42 1991 Commercial 4.09 1991 Electric 25.12 1991 Industry 20.32 1991 Residential 6.39 1991 Transportation 40.50 1992 All 97.68 1992 Commercial 4.52 1992 Electric 26.69 1992 Industry 19.27 1992 Residential 6.97 1992 Transportation 40.24 1993 All 102.25 1993 Commercial 4.92 1993 Electric 31.25 1993 Industry 17.69 1993 Residential 7.17 1993 Transportation 41.22 1994 All 101.21 1994 Commercial 4.98 1994 Electric 29.16 1994 Industry 18.05 1994 Residential 7.10 1994 Transportation 41.91 1995 All 103.32 1995 Commercial 5.20 1995 Electric 30.36 1995 Industry 18.02 1995 Residential 7.20 1995 Transportation 42.54 1996 All 107.93 1996 Commercial 5.94 1996 Electric 33.06 1996 Industry 17.96 1996 Residential 8.13 1996 Transportation 42.84 1997 All 110.25 1997 Commercial 5.47 1997 Electric 34.35 1997 Industry 18.41 1997 Residential 7.79 1997 Transportation 44.23 1998 All 111.67 1998 Commercial 5.31 1998 Electric 36.22 1998 Industry 18.14 1998 Residential 7.12 1998 Transportation 44.89 1999 All 113.80 1999 Commercial 5.27 1999 Electric 37.80 1999 Industry 17.67 1999 Residential 7.25 1999 Transportation 45.81 2000 All 122.55 2000 Commercial 5.73 2000 Electric 42.30 2000 Industry 17.69 2000 Residential 8.28 2000 Transportation 48.54 2001 All 120.53 2001 Commercial 5.23 2001 Electric 41.84 2001 Industry 17.46 2001 Residential 7.52 2001 Transportation 48.49 2002 All 119.03 2002 Commercial 4.89 2002 Electric 40.89 2002 Industry 17.28 2002 Residential 7.33 2002 Transportation 48.63 2003 All 122.88 2003 Commercial 5.55 2003 Electric 40.56 2003 Industry 18.35 2003 Residential 8.31 2003 Transportation 50.11 2004 All 127.37 2004 Commercial 5.46 2004 Electric 40.27 2004 Industry 18.83 2004 Residential 8.41 2004 Transportation 54.41 2005 All 129.14 2005 Commercial 5.49 2005 Electric 41.03 2005 Industry 18.72 2005 Residential 8.49 2005 Transportation 55.41 2006 All 122.56 2006 Commercial 4.88 2006 Electric 36.48 2006 Industry 17.64 2006 Residential 7.05 2006 Transportation 56.50 2007 All 127.95 2007 Commercial 4.98 2007 Electric 41.03 2007 Industry 17.95 2007 Residential 7.44 2007 Transportation 56.56
  9. Problem has been resolved. Thanks for everyone's help.
  10. It looks like the 2nd code section posted above, where it says: produces this result (only first 20 results listed) Is that what you meant? That is the query result I get from phpMyAdmin
  11. This query runs fine in phpMyAdmin. This query SELECT `y`.`year` AS `Year`, `i`.`industry` AS `Industry`, `e`.`emissions` AS `MMTCO2 Emissions` FROM `emissions` AS `e` INNER JOIN `year` AS `y` ON `y`.`y_id` = `e`.`y_id` INNER JOIN `industry` AS `i` ON `i`.`i_id` = `e`.`i_id` WHERE `e`.`s_id` = '1' ORDER BY `y`.`year` ASC, `i`.`industry` ASC; Produces this result (only first 20 results listed) Year Industry MMTCO2 Emissions 1990 All 109.94 1990 Commercial 2.34 1990 Electric 50.28 1990 Industry 26.04 1990 Residential 3.16 1990 Transportation 28.11 1991 All 113.14 1991 Commercial 1.92 1991 Electric 54.17 1991 Industry 25.30 1991 Residential 3.08 1991 Transportation 28.67 1992 All 119.91 1992 Commercial 2.02 1992 Electric 56.93 1992 Industry 28.37 1992 Residential 3.26 1992 Transportation 29.32 1993 All 124.71 1993 Commercial 1.94 1993 Electric 62.82 1993 Industry 26.96 1993 Residential 3.50 1993 Transportation 29.50 1994 All 122.78 1994 Commercial 1.95 1994 Electric 58.81 1994 Industry 27.92 1994 Residential 3.38 1994 Transportation 30.72 Here is the database schema. First string represents table name. (only first couple listed for space) state s_id state 1 Alabama 2 Alaska (etc... 51 total rows) year y_id year 1 1990 2 1991 (etc... 18 total rows) industry i_id industry 1 Commercial 2 Industry 3 Residential 4 Transportation 5 Electric 6 All emissions e_id s_id y_id i_id emissions 1 1 1 1 2.34 2 1 2 1 1.92 3 1 3 1 2.02 4 1 4 1 1.94 5 1 5 1 1.95 6 1 6 1 1.85 7 1 7 1 2.05 8 1 8 1 2.30 9 1 9 1 1.81 10 1 10 1 2.01 (etc... 5508 total rows) Here is the revised HTML code for the form <form method="post" action="results-state-all.php"> <select name="state"> <option value="select">--Choose A State--</option> <option value="1">Alabama</option> <option value="2">Alaska</option> <!-- etc... --> </select> <input type="submit" value="Display Results" /> </form> Here is my revised PHP so far: <?php require_once('mysqli_connect.php'); ?> // Alias for form selection $state = $_POST["state"]; // Mysql query $query = "SELECT `y`.`year` AS `Year`, `i`.`industry` AS `Industry`, `e`.`emissions` AS `MMTCO2 Emissions` FROM `emissions` AS `e` INNER JOIN `year` AS `y` ON `y`.`y_id` = `e`.`y_id` INNER JOIN `industry` AS `i` ON `i`.`i_id` = `e`.`i_id` WHERE `e`.`s_id` = '".$state."' ORDER BY `y`.`year` ASC, `i`.`industry` ASC"; $result = mysqli_query($connect, $query); // Query result while ($row = mysqli_fetch_array($result)) { echo '"<table><tr><td>" .$row["year"]. "</td> <td>" .$row["industry"]. "</td> <td>" .$row["emissions"]. "</td> </tr> </table>"'; } ?> Still getting this error on the mysqli_fetch_array statement: Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in ... on line 38
  12. Yes, I see your point. So your saying I wouldn't need 51 if statements (1 for each state)? Getting this error code: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in 'URL path' on line 60 Line 60 code is: $alRow = mysql_fetch_array($alResult);
  13. You think the problem is in the $alAll mySql query portion? It worked fine using phpMyAdmin.
  14. Hey everyone. Still learning PHP and have a ways to go. Was hoping for some help. I've got a database in mySql, and trying to get results printed in PHP from a drop-down menu selection. Here is my html code for the form: <form method="post" action="results.php"> <select name="state"> <option value="select">--Choose A State--</option> <option value="al">Alabama</option> <option value="ak">Alaska</option> <!-- etc... --> </select> <input type="submit" value="Display Results" /> </form> Here is the basic layout of results.php so far: <?php ini_set('display_errors',1); // Connect to server $connect = mysql_connect("url","user","pass"); // Connect to database mysql_select_db("dbname",$connect); // Kill command if (!$connect) { die('Could not connect to database.'); }; // Aliases for form selection $state = $_POST["state"]; // Mysql query $alAll = "SELECT `y`.`year` AS `Year`, `i`.`industry` AS `Industry`, `e`.`emissions` AS `MMTCO2 Emissions` FROM `emissions` AS `e` INNER JOIN `year` AS `y` ON `y`.`y_id` = `e`.`y_id` INNER JOIN `industry` AS `i` ON `i`.`i_id` = `e`.`i_id` WHERE `e`.`s_id` = 1 ORDER BY `y`.`year` ASC, `i`.`industry` ASC"; $alResult = mysql_query($alAll, $connect); $alRow = mysql_fetch_array($alResult); if ($state = "al") { echo "<table>"; echo "<tr>"; echo "<td>"; echo $alRow["year"]; echo "</td>"; echo "<td>"; echo $alRow["industry"]; echo "</td>"; echo "<td>"; echo $alRow["emissions"]; echo "</td>"; echo "</tr>"; echo "</table>"; } ?> I've tried doing this in multiple ways, but can't figure out how to print out mySql query based on state selection in PHP. MySql code works fine, as I have tested on MAMP. Any ideas?
  15. I'm missing something here. I want to change the color of the default value for this text field, without changing the overall color of the input field. For example, the default value of 170 will be gray, but when a user overwrites the data with their own numerical value, it will be black. I know how to change the color of the input field when a user types in data, but is there a way to change the color of the value= ? <input type="text" name="trans1_1" size="6" value="170"/> Any ideas? Seems like a simple task, but can't figure it out. Thanks in advance for the time.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.