Jump to content

smarthouseguy

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

smarthouseguy's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. it seems the first set of code is missing due to an ad.. let me post it again... <iframe src="../../../content/rss/weather/shg_weather_tmp.php">This page is written with Frames, but your browser is unable to display Frames.</iframe>
  2. Fantastic... works perfectly... thanks very much.... ;D
  3. ok.. so I have built a template for my subsite users with some news and weather feeds etc.... everything is variables contolled by a single variable file per user and seems to work great, but I am running into trouble when i want my content to refresh and would like the iframe to display the page which is set to auto refresh every 5 mins..... I was hoping to use iframes and have them autoscroll as opposed to using just a plain ole table so when my content refreshes only the iframe changes and the main page stays the same. but it seems that iframe is having trouble with the path... <iframe src="../../../content/rss/weather/shg_weather_tmp.php">This page is written with Frames, but your browser is unable to display Frames.</iframe> on the page i actually call the weather page like this: <? include $weather ?> the weather variable is: $weather="../../../content/rss/weather/shg_weather_tmp.php"; but it seems no matter how i try to call the file with the iframe it fails to find the file... any ideas?? Kind Regards, smarthouseguy
  4. I am a newbie to php... loving it so far.. this is what I did and it seems to work... if this is not correct please let me know... :-) [code]<?php $connection=mysql_connect("host","db","pass"); if (!$connection) { echo "Could not connect to MySql server!"; exit; } $db=mysql_select_db("asterisk",$connection); if (!$db) { echo "Could not select database"; exit; } $sql = 'SELECT * FROM `table`'; $mysql_result=mysql_query($sql,$connection); $num_rows=mysql_num_rows($mysql_result); if ($num_rows == 0) { echo "Sorry, we have no records"; } else { echo "<div align=\"center\"><table summary=\"HomePBX Call Detail Records\" cellspacing=\"0\" cellpadding=\"0\"><caption>$name's Call Detail Records</caption>"; echo "<tr><th class=\"title\">Call Date</th><th>Caller ID</th><th>Source</th><th>Destination</th><th>Duration</th></tr>"; if ($row=mysql_fetch_array($mysql_result)) { $result=$mysql_result; $id=$row["calldate"]; $var_1=$row["clid"]; $var_2=$row["src"]; $var_3=$row["dst"]; $var_4=$row["duration"]; $i = 0; while (($row=mysql_fetch_row($result)) !== false) { $i++; echo "<tr class=\"d".($i & 1)."\">"; echo "<td>".$row[0]."</td>"; echo "<td>".$row[1]."</td>"; echo "<td>".$row[2]."</td>"; echo "<td>".$row[3]."</td>"; echo "<td>".$row[4]."</td>"; echo "</tr>\n"; } mysql_free_result($result); } } mysql_close($connection); ?> </table></div> </body> </html>[/code] it seems like changing the first while loop to an if statement works... my next steps for this are to: [quote]1) get $row[4] to divide by 60 so I can take secs and make them mins 2) get $row[4] to sum for total mins and display above the table 3) add sort capabilities to the table data 4) have it split the data and make a new page after say 12 records and maybe an option to control how many records can be displayed 5) have export capabilites that will:   a) export data from the records with a date range   b) a php script that will auto bill by every 30 days exporting something like a monthly bill....       i)email the results of the monthly bill in a pdf or some other nice format       ii)add history links to previous month's data to the call detail record page [/quote] any ideas or direction will keep my frustration levels to a minimum... Kind regards
  5. I am getting the following error, not sure what I need to do to fix this... [quote]Warning: mysql_fetch_array(): 6 is not a valid MySQL result resource in /usr/local/apache2/htdocs/homepbx/kevin/home/cdr.php on line 23[/quote] [code] <?php $connection=mysql_connect("host","db","pass"); if (!$connection) { echo "Could not connect to MySql server!"; exit; } $db=mysql_select_db("asterisk",$connection); if (!$db) { echo "Could not select database"; exit; } $sql = 'SELECT * FROM `table`'; $mysql_result=mysql_query($sql,$connection); $num_rows=mysql_num_rows($mysql_result); if ($num_rows == 0) { echo "Sorry, we have no records"; } else { echo "<div align=\"center\"><table summary=\"HomePBX Call Detail Records\" cellspacing=\"0\" cellpadding=\"0\"><caption>$name's Call Detail Records</caption>"; echo "<tr><th class=\"title\">Call Date</th><th>Caller ID</th><th>Source</th><th>Destination</th><th>Duration</th></tr>"; while ($row=mysql_fetch_array($mysql_result)) { $result=$mysql_result; $id=$row["calldate"]; $var_1=$row["clid"]; $var_2=$row["src"]; $var_3=$row["dst"]; $var_4=$row["duration"]; $i = 0; while (($row=mysql_fetch_row($result)) !== false) { $i++; echo "<tr class=\"d".($i & 1)."\">"; echo "<td>".$row[0]."</td>"; echo "<td>".$row[1]."</td>"; echo "<td>".$row[2]."</td>"; echo "<td>".$row[3]."</td>"; echo "<td>".$row[4]."</td>"; echo "</tr>\n"; } mysql_free_result($result); } } mysql_close($connection); ?> </table></div> [/code] is this because of double while statements??? if I try to remove the [quote]while ($row=mysql_fetch_array($mysql_result)) {[/quote] I no longer get my data... all I am trying to accomplish with this right now is that the rows alternate color.. this is working, except for the error.... Any help will be greatly appreciated. Kind Regards, Smarthouseguy
×
×
  • 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.