
mark107
Members-
Posts
113 -
Joined
-
Last visited
Everything posted by mark107
-
does anyone know??
-
Yes, it is. The original time for the $time1 is: 6:00 PM 6:00 PM 7:00 PM 6:00 PM 7:00 PM 7:00 PM 7:00 PM 7:00 PM 7:00 PM 7:00 PM 7:00 PM 7:00 PM 7:00 PM 7:00 PM 7:00 PM 7:00 PM Yes, I'm converting the original time to a timestamp, because I want to get the 24 hours time, but the day date won't change. However, I tried this: //time1 $time1 = $html_two->find('span[id=time1]',0)->plaintext; $title1 = $html_two->find('span[id=title1]',0)->plaintext; $hoursMinutes = explode(":", $time1[0]); $hours = $hoursMinutes[0]; $minutes = $hoursMinutes[1]; $time1 = explode(" ", $time1); $hoursMinutes = explode(":", $time1[0]); $hours = $hoursMinutes[0]; $minutes = $hoursMinutes[1]; if($time1[1] == "PM") { $time1[0] = date("Ymd") . ((int)($hours) + 12) . $minutes . "00"; } else { $time1[0] = date("Ymd") . $hours . $minutes . "00"; } $program_list[$count]['start_time1'] = $time1[0]; It wont let me to change the day date and also it won't let me to have the 24 hours clock, only 12 hours. Can you please tell me what change I need to make in order i can make the 24 hours clock and change the day date depends on the current day?
-
Hi all, I need your help with my PHP, I have got the date and time format especially the year, month, day date, hours, minutes and seconds. I have got a little problem with the day date. Most of the day date are correct, but some of them are not correct. Example: 20140407230000, 20140408233000, 20140408000000, 20140408003000. If you can take a look an the 20140408230000, you will see that 2014 is the year, 04 is the month, 08 is the day date, 23 is the hours, 00 is the minutes and seconds. From what I have got, the day date are wrong. I have the 08 day date when I'm on the 23 hours at the same day which is correct, but when I have the 00 hours I should have the day date 09 instead of 08. Here is the code: <?php ini_set('max_execution_time', 300); $errmsg_arr = array(); $errflag = false; $link; include ('simple_html_dom.php'); $html = file_get_html("http://www.mysite.com/get-listing.php?channels=" . $channel . "&id=" . $my_id); $time1 = $html_two->find('span[id=time1]',0)->plaintext; $time1i = strtotime($time1); $title1 = $html_two->find('span[id=title1]',0)->plaintext; $hours = $hoursMinutes[0]; $minutes = $hoursMinutes[1]; $program_list[$count]['start_time1'] = date('YmdHis',$time1i); $xml .= " <channel id='" . $my_id. " " . $channel . "'>"; $xml .= " <display-name>" . $my_id. " " . $channel; $xml .= "</display-name>"; $xml .= " <programme channel='" . $my_id. " " . $channel . "' start='" . $program_list[$i]['start_time1'] . "' stop='" . $program_list[$i]['end_time1'] . "'>"; $xml .= " </programme>"; $xml .= " </channels>"; echo $xml; ?> Can you please tell me how I can change the day date to the next day date when I am on the 00 hours using with my code? Thanks in advance.
-
does anyone know how???????????
-
Hi all, I'm working on my PHP to generating the xml output. I use simple_html_dom method to parsing the contains from my script called get-listing.php. Here is my PHP script: <?php ini_set('max_execution_time', 300); $errmsg_arr = array(); $errflag = false; $link; include ('simple_html_dom.php'); $base1 = "http://www.mysite.com/get-listing.php"; $html = file_get_html($base1); $countp = $html->find('p'); header("Content-type: text/xml"); $xml .= "<?xml version='1.0' encoding='UTF-8' ?>"; //echo $xml; $xml .= '<tv generator-info-name="www.testbox.elementfx.com/xmltv">'; ?> Output for get-listing.php: <p id='channels'>ABC FAMILY</p><p id='links'><a href='http://www.mysite.com/get-listing.php?channels=ABC FAMILY&id=101'></p><a id="aTest" href="">Stream 1</a><br><br><p id='channels'>102 CBS</p><p id='links'><a href='http://www.mysite.com/get-listing.php?channels=CBS&id=102'></p><a id="aTest" href="">Stream 1</a><br><br> Here is the output for ABC-FAMILY: <span id="time1">9:00 PM </span> - <span id="title1">17 Again</span><br><br><span id="time2">11:00 PM </span> - <span id="title2">The 700 Club</span><br><br> Here is the output for CBS: <span id="time1">9:00 PM </span> - <span id="title1">Unforgettable: Til Death</span><br><br><span id="time2">10:00 PM </span> - <span id="title2">Hawaii Five-0: Ho'i Hou</span><br><br> I'm creating the variable so I can connect to get-listing.php script. I want to create the loops variable to get the list of url from get-listing.php with each html tag called `<p id="links">`. And also I want to get the list of contains from the get-listing.php when I open on each url. The contains I want to get from the tags is called `<span id="title1">` and `<span id="title2">`. Can you please tell me how I can create the loops to get the list of url from each tag `<p id='links'>` to open them using with `simple_html_dom` and how I can get the list of contains I want to get from abc-family and cbs output?
-
Same things that it goes for you......FY........Can you please show me an example how I can use getElementsByTagName() to get all the span then loop over to grab the right id using with the value?
-
I have the list of tags in php and I want to get the contents. for example: <li class="zc-ssl-pg" id="row0-1" style=""> <span id="row1Time" class="zc-ssl-pg-time">6:00 PM</span> <a id="rowTitle1" class="zc-ssl-pg-title" href='http://www.mysite.com'>Melissa & Joey</a> <a class="zc-ssl-pg-ep" href='http://www.mysite.com'>"House Broken"</a> <li class="zc-ssl-pg" id="row1-1" style=""> <span id="row1Time" class="zc-ssl-pg-time">6:00 PM</span> <a id="rowTitle1" class="zc-ssl-pg-title" href='http://www.mysite.com'>The Middle</a> <a class="zc-ssl-pg-ep" href='http://www.mysite.com'>"Thanksgiving IV"</a> Here's the PHP: <?php $errmsg_arr = array(); $errflag = false; $link; function db_connect() { define('DB_HOST', 'localhost'); define('DB_USER', 'myusername'); define('DB_PASSWORD', 'mypassword'); define('DB_DATABASE', 'mydbname'); $errmsg_arr = array(); $errflag = false; $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); if(!$link) { die('Failed to connect to server: ' . mysql_error()); } $db = mysql_select_db(DB_DATABASE); if(!$db) { die("Unable to select database"); } } db_connect(); $qrytable1="SELECT id, channels, links, streams FROM tvguide"; $result1=mysql_query($qrytable1) or die('Error:<br />' . $qry . '<br />' . mysql_error()); $links = "WEBSITE URL"; $result = file_get_contents($links); $dom = new DOMDocument(); $dom->loadHTML($result); echo $dom->getElementById('row1Time')->nodeValue . "<br>"; ?> When I use the code as above, it will only get the contents from the tags with array value 0. I want to get the tags `row1Time, rowTitle1 and zc-ssl-pg-ep with the array 1 value. Can you please tell me how I can get the contents from the class tags with the array value 1 using with DOMDocument?
-
Great, I'm glad to hear that you got what I mean. Can you tell me how I can use the file_get_contents to open the url in get-listing.php to get the url in each array to retrieve the data and output it using with "$xml .= "<programme channel=\"{$arr['channel_id']}\" start=\"{$arr['start']}\" stop=\"{$arr['stop']}\">";?
-
@objnoob: I don't need two PHP extensions, it is already been built there. ......YOU DID NOT READ MY POST CAREFULLY... What I said in my first post that I want to get the list of links for each array in get-listing.php like this: http://testbox.elementfx.com/get-listing.php?channels=ABC FAMILY&id=101 http://testbox.elementfx.com/get-listing.php?channels=CBS&id=102 http://testbox.elementfx.com/get-listing.php?channels=CNN USA&id=103 http://testbox.elementfx.com/get-listing.php?channels=ESPN USA&id=105 ..and so on I want to connect on each link in my PHP for each array to get the list of programme info to output them in the XML source. Here's for e.g: http://testbox.elementfx.com/get-listing.php I want to connect on get-listing.php to get the list of links on each array and I want to connect on each link in the get-listing.php to get the programme info. CBS programme info: <span id="time1">12:00 PM </span> - <span id="title1">2014 NCAA Basketball Tournament"Dayton vs. Ohio State - LIVE</span><br><br> <span id="time2">2:30 PM </span> - <span id="title2">2014 NCAA Basketball Tournament"Western Michigan vs. Syracuse - LIVE</span><br><br> <span id="time3">5:00 PM </span> - <span id="title3">Local Programming</span><br><br> <span id="time4">6:00 PM </span> - <span id="title4">Local Programming</span><br><br> <span id="time5">7:00 PM </span> - <span id="title5">2014 NCAA Basketball Tournament"Wofford vs. Michigan - LIVE</span><br><br> <span id="time6">9:30 PM</span> - <span id="title6">2014 NCAA Basketball Tournament"Arizona State vs. Texas - LIVE</span><br><br> <span id="time7">12:00 AM </span> - <span id="title7"> 1 Local Programming</span><br><br> <span id="time8">12:35 AM </span> - <span id="title8">Late Show With David LettermanTV-PG </span><br><br> <span id="time9">1:37 AM </span> - <span id=title9>The Late Late Show With Craig FergusonTV-14 </span><br><br> CNN programme info: <span id="time1">1:00 PM </span> - <span id="title1">Wolf</span><br><br> <span id="time2">2:00 PM </span> - <span id="title2">CNN Newsroom</span><br><br> <span id="time3">4:00 PM </span> - <span id="title3">The Lead With Jake Tapper</span><br><br> <span id="time4">5:00 PM </span> - <span id="title4">The Situation Room</span><br><br> <span id="time5">6:30 PM </span> - <span id="title5">Crossfire</span><br><br> <span id="time6">7:00 PM </span> - <span id="title6">Erin Burnett OutFront</span><br><br> <span id="time7">8:00 PM </span> - <span id="title7">Anderson Cooper 360</span><br><br> <span id="time8">9:00 PM </span> - <span id="title8">Piers Morgan Live</span><br><br> <span id="time9">10:00 PM </span> - <span id="title9">CNN Spotlight</span><br><br> I want to get the list of programme info from each tag of <span id="title1, <span id="title2, <span id="title3...etc to allow me to generating for each xml tag <programme channel="CHANNEL NAME" start="s1" stop="e1">, <programme channel="CHANNEL NAME" start="s2" stop="e2"> with each different start and end times then output the programe title in each xml tag called <title lang="en">. The output for the XML would be looks like this: <?xml version="1.0" encoding="UTF-8" ?> <tv generator-info-name="www.testbox.elementfx.com/xmltv"> <channel id="CBS"> <display-name>CBS</display-name> <programme channel="CBS" start="s1" stop="e1"> <title lang="en">2014 NCAA Basketball Tournament"Dayton vs. Ohio State - LIVE</title> <sub-title lang="en">sub title</sub-title> <desc lang="en">program description1</desc> <category lang="en">some category</category> </programme> <programme channel="CBS" start="s2" stop="e2"> <title lang="en">2014 NCAA Basketball Tournament"Western Michigan vs. Syracuse - LIVE</title> <sub-title lang="en">sub title</sub-title> <desc lang="en">program description1</desc> <category lang="en">some category</category> </programme> <programme channel="CBS" start="s3" stop="e3"> <title lang="en">Local Programming</title> <sub-title lang="en">sub title</sub-title> <desc lang="en">program description1</desc> <category lang="en">some category</category> </programme> <programme channel="CBS" start="s4" stop="e4"> <title lang="en">Local Programming</title> <sub-title lang="en">sub title</sub-title> <desc lang="en">program description1</desc> <category lang="en">some category</category> </programme> </channel> <channel id="CNN USA"> <display-name>CNN USA</display-name> <programme channel="CNN USA" start="s1" stop="e1"> <title lang="en">Wolf</title> <sub-title lang="en">sub title</sub-title> <desc lang="en">program description1</desc> <category lang="en">some category</category> </programme> <programme channel="CNN USA" start="s2" stop="e2"> <title lang="en">CNN Newsroom</title> <sub-title lang="en">sub title</sub-title> <desc lang="en">program description1</desc> <category lang="en">some category</category> </programme> <programme channel="CNN USA" start="s3" stop="e3"> <title lang="en">The Lead With Jake Tapper</title> <sub-title lang="en">sub title</sub-title> <desc lang="en">program description1</desc> <category lang="en">some category</category> </programme> <programme channel="CNN USA" start="s4" stop="e4"> <title lang="en">The Situation Room</title> <sub-title lang="en">sub title</sub-title> <desc lang="en">program description1</desc> <category lang="en">some category</category> </programme> </channel> </tv> Do you know how i can do that using my PHP?
-
does anyone know how i can do this? anyone?
-
Hi all, I need your help. I want to get access on each PHP link for each array to get the list of programme title to output them in the XML source. Here's for e.g: http://testbox.elementfx.com/get-listing.php I want to access to get-listing.php and I want to get the cbs link to access and get the list of programming info: <span id="time1">12:00 PM </span> - <span id="title1">2014 NCAA Basketball Tournament"Dayton vs. Ohio State - LIVE</span><br><br> <span id="time2">2:30 PM </span> - <span id="title2">2014 NCAA Basketball Tournament"Western Michigan vs. Syracuse - LIVE</span><br><br> <span id="time3">5:00 PM </span> - <span id="title3">Local Programming</span><br><br> <span id="time4">6:00 PM </span> - <span id="title4">Local Programming</span><br><br> <span id="time5">7:00 PM </span> - <span id="title5">2014 NCAA Basketball Tournament"Wofford vs. Michigan - LIVE</span><br><br> <span id="time6">9:30 PM</span> - <span id="title6">2014 NCAA Basketball Tournament"Arizona State vs. Texas - LIVE</span><br><br> <span id="time7">12:00 AM </span> - <span id="title7"> 1 Local Programming</span><br><br> <span id="time8">12:35 AM </span> - <span id="title8">Late Show With David LettermanTV-PG </span><br><br> <span id="time9">1:37 AM </span> - <span id=title9>The Late Late Show With Craig FergusonTV-14 </span><br><br> CBS link: http://testbox.elementfx.com/get-listing.php?channels=CBS&id=102 <?php function db_connect() { define('DB_HOST', 'localhost'); define('DB_USER', 'myusername'); define('DB_PASSWORD', 'mypassword'); define('DB_DATABASE', 'mydbname'); $errmsg_arr = array(); $errflag = false; $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); if(!$link) { die('Failed to connect to server: ' . mysql_error()); } $db = mysql_select_db(DB_DATABASE); if(!$db) { die("Unable to select database"); } } db_connect(); function clean($var) { return mysql_real_escape_string(strip_tags($var)); } $channels = clean($_GET['channels']); $id = clean($_GET['id']); if($errflag) { $_SESSION['ERRMSG_ARR'] = $errmsg_arr; echo implode('<br />',$errmsg_arr); } else { $insert = array(); if(isset($_GET['channels'])) { $insert[] = 'channels = \'' . clean($_GET['channels']) .'\''; } if(isset($_GET['id'])) { $insert[] = 'id = \'' . clean($_GET['id']) . '\''; } if(!$channels && ! $id) { $qrytable1="SELECT id, channels, links, streams FROM tvguide"; $result1=mysql_query($qrytable1) or die('Error:<br />' . $qry . '<br />' . mysql_error()); while ($row = mysql_fetch_array($result1)) { // fake some example data. the actual data would be retrieved from a database query $data[] = array('channel_id'=>$row['channels'], 'display_name'=>$row['channels'], 'program_id'=>123,'start'=>'s1','stop'=>'e1', 'title'=>'program title', 'sub_title'=>'sub title', 'description'=>'program description1', 'category'=>'some category'); // build the xml $xml = '<?xml version="1.0" encoding="UTF-8" ?> <tv generator-info-name="www.testbox.elementfx.com/xmltv">'; $last_channel = null; // used to detect when the channel changes foreach($data as $arr) { if($last_channel != $arr['channel_id']) { // the channel changed if($last_channel != null) { // not the first channel, close out the previous channel $xml .= " </channel> \n"; } // start a new channel $xml .= " <channel id=\"{$arr['channel_id']}\">"; $xml .= " <display-name>{$arr['display_name']}</display-name>"; $last_channel = $arr['channel_id']; } // output the program info under each channel $xml .= " <programme channel=\"{$arr['channel_id']}\" start=\"{$arr['start']}\" stop=\"{$arr['stop']}\">"; // i don't see a program id in this definition, but it likely needs one $xml .= " <title lang=\"en\">{$arr['title']}</title>"; $xml .= " <sub-title lang=\"en\">{$arr['sub_title']}</sub-title>"; $xml .= " <desc lang=\"en\">{$arr['description']}</desc>"; $xml .= " <category lang=\"en\">{$arr['category']}</category>"; $xml .= " </programme>"; } if($last_channel != null) { // close out the previous channel if any $xml .= ' </channel>'; } } } $xml .= ' </tv>'; // output the xml to the browser in this example, write $xml to a file here... header("Content-Type: text/xml"); echo $xml; $handle = fopen("myChannel.xml", "w"); fwrite ($handle, $xml); } ?> The same things that it goes for each array in the get-listing.php. Can you please tell me how I can get the list of strings from each PHP tag `<span id="title1">`, `<span id="title2">` `<span id="title3">` and so on to output for each strings in each xml tag called `<title lang="en">` for each programme using my php source? Thanks in advance
-
@mac_gyver: Thanks for your help. There are two things I need to make some changes. I want to know how do you break for each xml tag for </channel> to allow to make it separate with <channel id=""> tag which I want to make it looks like this: Here's what is my PHP output: Here's the code: <?php function db_connect() { define('DB_HOST', 'localhost'); define('DB_USER', 'myusername'); define('DB_PASSWORD', 'mypassword'); define('DB_DATABASE', 'mydbname'); $errmsg_arr = array(); $errflag = false; $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); if(!$link) { die('Failed to connect to server: ' . mysql_error()); } $db = mysql_select_db(DB_DATABASE); if(!$db) { die("Unable to select database"); } } db_connect(); function clean($var) { return mysql_real_escape_string(strip_tags($var)); } $channels = clean($_GET['channels']); $id = clean($_GET['id']); if($errflag) { $_SESSION['ERRMSG_ARR'] = $errmsg_arr; echo implode('<br />',$errmsg_arr); } else { $insert = array(); if(isset($_GET['channels'])) { $insert[] = 'channels = \'' . clean($_GET['channels']) .'\''; } if(isset($_GET['id'])) { $insert[] = 'id = \'' . clean($_GET['id']) . '\''; } if(!$channels && ! $id) { $qrytable1="SELECT id, channels, links, streams FROM tvguide"; $result1=mysql_query($qrytable1) or die('Error:<br />' . $qry . '<br />' . mysql_error()); while ($row = mysql_fetch_array($result1)) { // fake some example data. the actual data would be retrieved from a database query $data[] = array('channel_id'=>$row['channels'], 'display_name'=>$row['channels'], 'program_id'=>123,'start'=>'s1','stop'=>'e1', 'title'=>'program title', 'sub_title'=>'sub title', 'description'=>'program description1', 'category'=>'some category'); // build the xml $xml = '<?xml version="1.0" encoding="UTF-8" ?> <tv generator-info-name="www.mysite.com/xmltv">'; $last_channel = null; // used to detect when the channel changes foreach($data as $arr) { if($last_channel != $arr['channel_id']) { // the channel changed if($last_channel != null){ // not the first channel, close out the previous channel $xml .= ' </channel> '; } // start a new channel $xml .= " <channel id=\"{$arr['channel_id']}\">"; $xml .= " <display-name>{$arr['display_name']}</display-name>"; $last_channel = $arr['channel_id']; } // output the program info under each channel $xml .= " <programme channel=\"{$arr['channel_id']}\" start=\"{$arr['start']}\" stop=\"{$arr['stop']}\">"; // i don't see a program id in this definition, but it likely needs one $xml .= " <title lang=\"en\">{$arr['title']}</title>"; $xml .= " <sub-title lang=\"en\">{$arr['sub_title']}</sub-title>"; $xml .= " <desc lang=\"en\">{$arr['description']}</desc>"; $xml .= " <category lang=\"en\">{$arr['category']}</category>"; $xml .= " </programme>"; } if($last_channel != null) { // close out the previous channel if any $xml .= ' </channel>'; } } } $xml .= ' </tv>'; // output the xml to the browser in this example, write $xml to a file here... header("Content-Type: text/xml"); echo $xml; } ?> Can you please tell me how do you break for each xml tag for </channel> to allow to make it to get separate with <channel id=""> tag? And how I can save the xml file in my webhost?
-
anyone????????????????????
-
@mac_gyver: My xml definition does make complete sense, you did not read my first post carefully what I want to achieve. The source you post it doesn't match in my needs. I want to get the arrays of channel from mysql database and I want to output them in each xml tag called `channel` then save the xml file called myChannel.xml. I want to make xml source that looks like this: <?xml version="1.0" encoding="UTF-8" ?> <tv generator-info-name="www.mysite.com/xmltv"> <channel id="row1"> <display-name>row1</display-name> <programme channel="row1" start="" stop=""> <title lang="en"></title> <sub-title lang="en"> </sub-title> <desc lang="en"></desc> <category lang="en"></category> </programme> </channel> <channel id="row2"> <display-name>row2</display-name> <programme channel="row2" start="" stop=""> <title lang="en"></title> <sub-title lang="en"> </sub-title> <desc lang="en"></desc> <category lang="en"></category> </programme> </channel> <channel id="row3"> <display-name>row3</display-name> <programme channel="row3" start="" stop=""> <title lang="en"></title> <sub-title lang="en"> </sub-title> <desc lang="en"></desc> <category lang="en"></category> </programme> </channel> </tv> Here's what my xml output looks like: <?xml version="1.0" encoding="UTF-8"?> <tv generator-info-name="www.mysite.com/xmltv"><channel><display-name>Information from database</display-name><programme/><desc/></channel></tv> As you can see the difference between my xml source and the other xml source i want to make it, on my xml source it doesn't look the same as the other xml source. Can you modify the source I use to allow me to output the list of arrays of rows from mysql to put the rows in the xml tag `channel`, `display-name` and `programme channel`?
-
Hi all, I need some of your help, I'm working on my PHP script to create the XML document with encoding utf8 so I can generate the XML file to allow me to save the XML file in my web host. I want to make the xml output to something like this: <?xml version="1.0" encoding="UTF-8" ?> <tv generator-info-name="www.mysite.com/xmltv"> <channel id=""> <display-name>Information from database</display-name> <programme channel="Information from database" start="" stop=""> <title lang="en"></title> <sub-title lang="en"> </sub-title> <desc lang="en"></desc> <category lang="en"></category> </programme> </channel> Here's what my XML output looks like: <?xml version="1.0" encoding="UTF-8"?> <tv generator-info-name="www.mysite.com/xmltv"><channel><display-name>Information from database</display-name><programme/><desc/></channel></tv> Here's the current code: <?php function db_connect() { define('DB_HOST', 'localhost'); define('DB_USER', 'myusername'); define('DB_PASSWORD', 'mypassword'); define('DB_DATABASE', 'mydbname'); $errmsg_arr = array(); $errflag = false; $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); if(!$link) { die('Failed to connect to server: ' . mysql_error()); } $db = mysql_select_db(DB_DATABASE); if(!$db) { die("Unable to select database"); } } db_connect(); function clean($var) { return mysql_real_escape_string(strip_tags($var)); } $channels = clean($_GET['channels']); $id = clean($_GET['id']); if($errflag) { $_SESSION['ERRMSG_ARR'] = $errmsg_arr; echo implode('<br />',$errmsg_arr); } else { $insert = array(); if(isset($_GET['channels'])) { $insert[] = 'channels = \'' . clean($_GET['channels']) .'\''; } if(isset($_GET['id'])) { $insert[] = 'id = \'' . clean($_GET['id']) . '\''; } if($channels && $id) { $qrytable1="SELECT id, channels, links FROM tvguide WHERE channels='$channels' && id='$id'"; $result1=mysql_query($qrytable1) or die('Error:<br />' . $qry . '<br />' . mysql_error()); echo '<?xml version="1.0" encoding="UTF-8" ?> <tv generator-info-name="www.mysite.com/xmltv"> <channel id=""> <display-name></display-name> <programme channel="" start="" stop=""> <title lang="en"></title> <sub-title lang="en"></sub-title> <desc lang="en"></desc> <category lang="en"></category> </programme> </channel> </tv>'; while ($row = mysql_fetch_array($result1)) { } mysql_close(); } else if(!$channels && ! $id) { $qrytable1="SELECT id, channels, links, streams FROM tvguide"; $result1=mysql_query($qrytable1) or die('Error:<br />' . $qry . '<br />' . mysql_error()); while ($row = mysql_fetch_array($result1)) { } mysql_close(); } } // create a dom document with encoding utf8 $domtree = new DOMDocument('1.0', 'UTF-8'); // create a root element of the xml tree $tv = $domtree->createElement('tv'); //create attributes for element $generator_info_name = $domtree->createAttribute('generator-info-name'); $generator_info_name->value = 'www.mysite.com/xmltv'; //append attribute $tv->appendChild($generator_info_name); // append element to the doc $tv = $domtree->appendChild($tv); //add a channel as a child of the root $channel = $domtree->createElement('channel'); $channel_id = $domtree->createAttribute('id'); $channel_id->value = '""'; $channel = $tv->appendChild($channel); //append children to channel $channel->appendChild($domtree->createElement('display-name','Information from database')); $channel->appendChild($domtree->createElement("programme")); $channel->appendChild($domtree->createElement('desc')); //finally, save the file echo $domtree->saveXML(); $domtree->save('myChannel.xml'); ?> Do you know how I can make the same XML output as the first code? And how I can output for each data from mysql database to put it in each channel tag and I want to add the tags under the channel tag including the display-name, programme-channel, title, sub-title, desc and category tags when I output for each data from mysql? Any advise would be much appreciated. Thanks in advance
-
?????????????????????????????????
-
Hi guys, I have got a problem with scraping the data from a third party website. I'm currently using a preg_match_all method with each different title tags including the values to output the data from a third party website to my website where I can see some of the data are missing. Here's what the HTML is look like from a third party: <span id="row1Time" class="zc-ssl-pg-time">9:00 AM</span> <a id="rowTitle1" class="zc-ssl-pg-title">CBS News Sunday Morning</a> <span id="row2Time" class="zc-ssl-pg-time">10:30 AM</span> <a id="rowTitle2" class="zc-ssl-pg-title">Face the Nation</a> <span id="row3Time" class="zc-ssl-pg-time">11:30 AM</span> <span id="rowTitle3" class="zc-ssl-pg-title">Local Programming</span> <span id="row4Time" class="zc-ssl-pg-time">12:00 PM</span> <a id="rowTitle4" class="zc-ssl-pg-title">The NFL Today</a> <span id="row5Time" class="zc-ssl-pg-time">1:00 PM</span> <a id="rowTitle5" class="zc-ssl-pg-title">NFL Football</a> <span id="row6Time" class="zc-ssl-pg-time">4:30 PM</span> <a id="rowTitle6" class="zc-ssl-pg-title"'>2013 U.S. Open Tennis</a> <span id="row7Time" class="zc-ssl-pg-time">7:00 PM</span> <span id="rowTitle7" class="zc-ssl-pg-title">Local Programming</span> <span id="row8Time" class="zc-ssl-pg-time">7:30 PM</span> <a id="rowTitle8" class="zc-ssl-pg-title">CBS Evening News</a> Here is the HTML output data on my website: <span id='time1'>9:00 AM</span> - <span id='title1'>CBS News Sunday Morning</span><br></br> <span id='time2'>10:30 AM</span> - <span id='title2'>Face the Nation</span><br></br> <span id='time3'></span> - <span id='title3'></span><br></br> <span id='time4'>12:00 PM</span> - <span id='title4'>The NFL Today</span><br></br> <span id='time5'>3:30 PM</span> - <span id='title5'>The Bold and the Beautiful</span><br></br> <span id='time6'>4:00 PM</span> - <span id='title6'>The Talk</span><br></br> <span id='time7'></span> - <span id='title7'></span><br></br> <span id='time8'>7:30 PM</span> - <span id='title8'>CBS Evening News</span><br></br> Here's the php code: <?php define('DB_HOST', 'localhost'); define('DB_USER', 'myusername'); define('DB_PASSWORD', 'mypassword'); define('DB_DATABASE', 'mydb'); $errmsg_arr = array(); $errflag = false; $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); if(!$link) { die('Failed to connect to server: ' . mysql_error()); } $db = mysql_select_db(DB_DATABASE); if(!$db) { die("Unable to select database"); } function clean($var) { return mysql_real_escape_string(strip_tags($var)); } $channels = clean($_GET['channels']); $id = clean($_GET['id']); if($errflag) { $_SESSION['ERRMSG_ARR'] = $errmsg_arr; echo implode('<br />',$errmsg_arr); } else { $insert = array(); if(isset($_GET['channels'])) { $insert[] = 'channels = \'' . clean($_GET['channels']) .'\''; } if(isset($_GET['id'])) { $insert[] = 'id = \'' . clean($_GET['id']) . '\''; } if($channels && $id) { $qrytable1="SELECT id, channels, links FROM tvguide WHERE channels='$channels' && id='$id'"; $result1=mysql_query($qrytable1) or die('Error:<br />' . $qry . '<br />' . mysql_error()); while ($row = mysql_fetch_array($result1)) { $links = $row['links']; $data = file_get_contents($links); preg_match_all('/<span id="row1Time\" class="zc-ssl-pg-time">([^<]+)<\/span>[^>]+>([^<]+)<\/a>/im', $data, $matches); preg_match_all('/<a id="rowTitle1\" class="zc-ssl-pg-title"[^>]*>([^<]+)<\/a>/im', $data, $matches1); $time1 = $matches[1]; $titles1 = $matches1[1]; echo "<span id='time1'>".$time1[1]."</span> - <span id='title1'>".$titles1[1]."</span><br></br>"; preg_match_all('/<span id="row2Time\" class="zc-ssl-pg-time">([^<]+)<\/span>[^>]+>([^<]+)<\/a>/im', $data, $matches); preg_match_all('/<a id="rowTitle2\" class="zc-ssl-pg-title"[^>]*>([^<]+)<\/a>/im', $data, $matches2); $time2 = $matches[1]; $titles2 = $matches2[1]; echo "<span id='time2'>".$time2[1]."</span> - <span id='title2'>".$titles2[1]."</span><br></br>"; preg_match_all('/<span id="row3Time\" class="zc-ssl-pg-time">([^<]+)<\/span>[^>]+>([^<]+)<\/a>/im', $data, $matches); preg_match_all('/<a id="rowTitle3\" class="zc-ssl-pg-title"[^>]*>([^<]+)<\/a>/im', $data, $matches3); $time3 = $matches[1]; $titles3 = $matches3[1]; echo "<span id='time3'>".$time3[1]."</span> - <span id='title3'>".$titles3[1]."</span><br></br>"; preg_match_all('/<span id="row4Time\" class="zc-ssl-pg-time">([^<]+)<\/span>[^>]+>([^<]+)<\/a>/im', $data, $matches); preg_match_all('/<a id="rowTitle4\" class="zc-ssl-pg-title"[^>]*>([^<]+)<\/a>/im', $data, $matches4); $time4 = $matches[1]; $titles4 = $matches4[1]; echo "<span id='time4'>".$time4[1]."</span> - <span id='title4'>".$titles4[1]."</span><br></br>"; preg_match_all('/<span id="row5Time\" class="zc-ssl-pg-time">([^<]+)<\/span>[^>]+>([^<]+)<\/a>/im', $data, $matches); preg_match_all('/<a id="rowTitle5\" class="zc-ssl-pg-title"[^>]*>([^<]+)<\/a>/im', $data, $matches5); $time5 = $matches[1]; $titles5 = $matches5[1]; echo "<span id='time5'>".$time5[1]."</span> - <span id='title5'>".$titles5[1]."</span><br></br>"; preg_match_all('/<span id="row6Time\" class="zc-ssl-pg-time">([^<]+)<\/span>[^>]+>([^<]+)<\/a>/im', $data, $matches); preg_match_all('/<a id="rowTitle6\" class="zc-ssl-pg-title"[^>]*>([^<]+)<\/a>/im', $data, $matches6); $time6 = $matches[1]; $titles6 = $matches6[1]; echo "<span id='time6'>".$time6[1]."</span> - <span id='title6'>".$titles6[1]."</span><br></br>"; preg_match_all('/<span id="row7Time\" class="zc-ssl-pg-time">([^<]+)<\/span>[^>]+>([^<]+)<\/a>/im', $data, $matches); preg_match_all('/<a id="rowTitle7\" class="zc-ssl-pg-title"[^>]*>([^<]+)<\/a>/im', $data, $matches7); $time7 = $matches[1]; $titles7 = $matches7[1]; echo "<span id='time7'>".$time7[1]."</span> - <span id='title7'>".$titles7[1]."</span><br></br>"; preg_match_all('/<span id="row8Time\" class="zc-ssl-pg-time">([^<]+)<\/span>[^>]+>([^<]+)<\/a>/im', $data, $matches); preg_match_all('/<a id="rowTitle8\" class="zc-ssl-pg-title"[^>]*>([^<]+)<\/a>/im', $data, $matches8); $time8 = $matches[1]; $titles8 = $matches8[1]; echo "<span id='time8'>".$time8[1]."</span> - <span id='title8'>".$titles8[1]."</span><br></br>"; } mysql_close($link); } else if(!$channels && ! $id) { $qrytable1="SELECT id, channels, links FROM tvguide"; $result1=mysql_query($qrytable1) or die('Error:<br />' . $qry . '<br />' . mysql_error()); while ($row = mysql_fetch_array($result1)) { echo "<p id='channels'>"; echo $row['channels']; echo "<p id='links'>"; echo . $row["channels"] . "&id=" . $row["id"] .'</p>'; } } } ?> Does anyone know how I can scrape the data using with the preg_match_all or similar method that I currently use including with the time and the title tags with the values so I can output the data without being missing? I tried with PHP DOM, but I have no idea how to scrape the ids and the classes. If you could post the example PHP DOM including with the ids and classes, I would be very grateful. Any advice would be much appreciated. Thanks in advance
-
Hi guys, I have got a problem with my JavaScript. I am using the code in my PHP to allow me to use ajax and JavaScript at the same time. There is a problem with the keyboard control, I have four blocks of div with each different size. When I have all four block on per row of div, I can be able to move the yellow block to the four blocks using with the keyboard right arrow button while the four div blocks are moving to the left. When I have one of the blocks that are big while I still have four blocks, I can be able to move the yellow block to the four blocks, but I cannot be able to move the four blocks to the left. Here is the code: <!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <script src="http://code.jquery.com/jquery-1.9.1.min.js" type="text/javascript"></script> <script type="text/javascript"> function GetXmlHttpObject() { if(window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari return new XMLHttpRequest(); } else { // code for IE6, IE5 return new ActiveXObject("Microsoft.XMLHTTP"); } return null; } var current_col = 1; var current_row = 1; $(document).keyup(function(event){ var yellowbg = $(".yellowbg"); var rowwidth = $(".row").css( "width").split("px"); var yellowbgdivclass = yellowbg.attr('class'); var splitclass = yellowbgdivclass.split(" "); var getcurrentrow = splitclass[1].split("_"); var mainWraptop = $(".mainWrap").position().top; var mainWrapheight = $(".mainWrap").height(); var rowmove=$("#rowmove").val(); //alert($(".row").length); var displayrowcount = 6; //is using for to hide other channels var rowheight = 42; var rowwidth = 1053; //is using for how much width the row is going to display while hide the other rows var rowwidth1 = 1303; //is using for how much width the row is going to display while hide the other rows var totalwidth_current = 0; var totalwidth_current1 = 0; if(parseInt(current_row)+parseInt(1) <=5) { for(var i=1; i<=(parseInt(current_row)+parseInt(1));i++ ) { var yellowbgnextdivwidth = $(".div_"+current_col+'_'+i).css( "width"); var yellowbgnextdivwidthsplit = yellowbgnextdivwidth.split("px"); totalwidth_current=parseInt(totalwidth_current)+parseInt(yellowbgnextdivwidthsplit[0]); } } if (event.keyCode == 39) { //right if (yellowbg.next().length) { var currentrowleft = $(".rowSubPgm div.pgmFirstRow:first").css( "margin-left").split("px"); currentrowleft1 = currentrowleft[0].split("-"); currentrowleft2 = currentrowleft[0].split("-"); if(typeof(currentrowleft2[1])!= "undefined") currentrowleft = currentrowleft2[1]; else if(typeof(currentrowleft1[1])!= "undefined") currentrowleft = currentrowleft1[1]; else currentrowleft = currentrowleft[0]; var nextdivwidth = $(".div_"+current_col+'_'+(parseInt(current_row)+parseInt(1))).css( "width").split("px"); //alert((parseInt(rowwidth)+parseInt(currentrowleft))); //alert(totalwidth_current); //alert((parseInt(rowwidth)+parseInt(currentrowleft)) < totalwidth_current); //alert(nextdivwidth); //alert(totalwidth_current); if((parseInt(rowwidth)+parseInt(currentrowleft)) < totalwidth_current) { $("body").find('.rowSubPgm').each(function(index) { //var approx = rowwidth/250; $(this).find('.pgmFirstRow:first').css( "margin-left", "-"+(rowwidth)+"px" ); }); $(".rows div:nth-child(2)").css( "margin-left", "-"+parseInt(rowleft)-70 ); } if((parseInt(rowwidth)+parseInt(currentrowleft1)) < totalwidth_current) { $(".div_"+current_col+'_'+current_row).css( "margin-left", "-"+rowleft ); } if((parseInt(rowwidth1)+parseInt(currentrowleft1)) > totalwidth_current) { $(".div_"+current_col+'_'+current_row).css( "margin-left", "-"+rowleft ); } if(yellowbg.next().position().top == yellowbg.position().top) { $(".div_"+current_col+'_'+current_row).css( "margin-left", "-"+rowleft ); } else { alert("5"); currentrowleft = parseInt(currentrowleft)+rowwidth; var rowleft = currentrowleft+="px"; $("body").find('.rowSubPgm').each(function(index) { $(this).find('.pgmFirstRow:first').css( "margin-left", "-"+rowleft ); }); $(".rows div:nth-child(2)").css("margin-left", "-"+parseInt(rowleft)-70); } current_row++; } } } Does anyone know how I can move the four block to the left using with the keyboard right arrow button control when I have one of the block that are big?? If you need to see my website link for better understanding, please let me know and I would be happy to send on PM. Any advice would be much appreciated. Thanks in advance
-
does anyone know??
-
Hi guys, I have got a problem with my current script and I really need your help. I have four blocks on my webpage, I am trying to scrape the title4" data from my other script to output it in my main page. I can be able to output three titles without have any problem, but I can't be able to output on four titles only three . Here is the code: function getSchule($link,j) { //var widthval = 350; var widthval = 850; var parts = $link.split("/"); var links = parts[parts.length-1]; var programlength = 0; $.ajax({ url:$.trim(links), type:'GET', data:'', success: function(data) { var $data = $(data); var title1 = $data.filter("#title1").html(); var title2 = $data.filter("#title2").html(); var title3 = $data.filter("#title3").html(); var title4 = $data.filter("#title4").html(); var time1 = $data.filter("#time1").html(); var time2 = $data.filter("#time2").html(); var time3 = $data.filter("#time3").html(); var time4 = $data.filter("#time4").html(); var time5 = $data.filter("#time5").html(); time1 = time1.split(" "); var time1AMPM = time1[1]; time1 = time1[0].split(":"); time1= time1[0]+'.'+time1[1]; if($.trim(time1AMPM) == 'PM' && time1<12) time1 = parseFloat(time1)+12; time2 = time2.split(" "); var time2AMPM = time2[1]; time2 = time2[0].split(":"); time2= time2[0]+'.'+time2[1]; if($.trim(time2AMPM) == 'PM' && time2<12) time2 = parseFloat(time2)+12; time3 = time3.split(" "); var time3AMPM = time3[1]; time3 = time3[0].split(":"); time3= time3[0]+'.'+time3[1]; if($.trim(time3AMPM) == 'PM' && time3<12) time3 = parseFloat(time3)+12; time4 = time4.split(" "); var time4AMPM = time4[1]; time4 = time4[0].split(":"); time4= time4[0]+'.'+time4[1]; if($.trim(time4AMPM) == 'PM' && time4<12) time4 = parseFloat(time4)+12; time5 = time5.split(" "); var time5AMPM = time5[1]; time5 = time5[0].split(":"); time5= time5[0]+'.'+time5[1]; if($.trim(time5AMPM) == 'PM' && time5<12) time5 = parseFloat(time5)+12; var difftime2time1 = (parseFloat(time2) - parseFloat(time1)).toFixed(2); var difftime3time2 = (parseFloat(time3) - parseFloat(time2)).toFixed(2); var difftime4time3 = (parseFloat(time4) - parseFloat(time3)).toFixed(2); var difftime5time4 = (parseFloat(time5) - parseFloat(time4)).toFixed(2); if(isNaN(difftime2time1)) { difftime2time1=0; } if(isNaN(difftime3time2)) { difftime3time2=0; } if(isNaN(difftime4time3)) { difftime4time3=0; } if(isNaN(difftime5time4)) { difftime5time4=0; } var currenttotal = 0; var firstele = ((j-1)*4)+1; // how many programme i want to output in per block var lastele = parseInt(firstele)+2; var k=1; var programlength = 0; for(;firstele <= lastele;firstele++) { var nexttimedate = parseInt(k)+1; programlength = parseFloat(programlength) + parseFloat(eval('difftime'+nexttimedate+'time'+k)); if((eval('difftime'+nexttimedate+'time'+k)) > 0.99 && (eval('difftime'+nexttimedate+'time'+k)) <=1.00 ) { $('#programe'+firstele).addClass("span1hr"); width[j]=517; } if((eval('difftime'+nexttimedate+'time'+k)) > 1.00 && (eval('difftime'+nexttimedate+'time'+k)) <=1.30 ) { $('#programe'+firstele).addClass("span1hr"); width[j]=517; } if((eval('difftime'+nexttimedate+'time'+k)) > 1.03 && (eval('difftime'+nexttimedate+'time'+k)) <=1.33 ) { $('#programe'+firstele).addClass("span1hr"); width[j]=517; } if((eval('difftime'+nexttimedate+'time'+k)) > 1.30 && (eval('difftime'+nexttimedate+'time'+k)) <=2.00 ) { $('#programe'+firstele).addClass("span1_5hr"); width[j]=701; } if((eval('difftime'+nexttimedate+'time'+k)) > 2.00 && (eval('difftime'+nexttimedate+'time'+k)) <=2.30 ) { $('#programe'+firstele).addClass("span2hr"); width[j]=1303; } if((eval('difftime'+nexttimedate+'time'+k)) > 2.30 && (eval('difftime'+nexttimedate+'time'+k)) <=3.00 ) { $('#programe'+firstele).addClass("span2_5hr"); width[j]=1553; } if((eval('difftime'+nexttimedate+'time'+k)) > 3.00 && (eval('difftime'+nexttimedate+'time'+k)) <=3.30 ) { $('#programe'+firstele).addClass("span3hr"); width[j]=1803; } if(programlength == 0.30) { if(currenttotal == 0) { $('#programe'+firstele).addClass("span0hr"); width[j]=250; } } if(programlength == 1.00) { if(currenttotal == 0) { $('#programe'+firstele).addClass("span1hr"); width[j]=517; } } if(programlength == 1.01) { if(currenttotal == 0) { $('#programe'+firstele).addClass("span1hr"); width[j]=517; } } if(programlength == 1.02) { if(currenttotal == 0) { $('#programe'+firstele).addClass("span1hr"); width[j]=517; } } if(programlength == 1.03) { if(currenttotal == 0) { $('#programe'+firstele).addClass("span1hr"); width[j]=517; } } if(programlength == 1.30) { if(currenttotal == 0) { $('#programe'+firstele).addClass("span1_5hr"); width[j]=701; } } if(programlength == 2.00) { if(currenttotal == 0) { $('#programe'+firstele).addClass("span2hr"); width[j]=1303; } } if(programlength == 2.30) { if(currenttotal == 0) { $('#programe'+firstele).addClass("span2_5hr"); width[j]=1553; } } if(programlength == 3.00) { if(currenttotal == 0) { $('#programe'+firstele).addClass("span3hr"); width[j]=1803; } } currenttotal++; pgmcontent[firstele] = eval('title'+k); k++; } checksum+=j; if(checksuminit == checksum) { for(var ii=1;ii<width.length-1;ii++) { widthval+=width[ii]; } for(var jj=1;jj <= pgmcontent.length-1;jj++) { $('#programe'+jj).html(pgmcontent[jj]); } for(var kk=1;kk <= imagecontent.length-1;kk++) { $('#image'+kk).html(imagecontent[kk]); } $("body").find('.rowSubPgm').each(function(index) { $(this).css( "width", widthval+"px"); }); $("div").show(); } } }); } I am using ajax to output the data to my main page. I can't be able to figure out where the trouble is coming from. Does anyone know what the problem is? Any idea??
-
help with create unlimited boxes for div classes
mark107 replied to mark107's topic in PHP Coding Help
I am trying to create unlimited of div classes when I store more than 8 rows in mysql. Please re-read my post I have just already said. -
Hi guys, I have got a problem with the code in my PHP. I stored 8 rows of channels in mysql database and I use var totalrowcount to display 8 boxes for div classes to display with rows that I stored from mysql, but I cannot be able to display more than 8 boxes of div classes when I store more than 8 rows in mysql. I want to create the unlimited boxes for div classes with any range of number to match the rows depends on how many rows that I store in mysql database. Here is the code I found where the trouble is coming from: var totalrowcount = 8; <div class="mainWrap"> <div class="row" id="row1"> <div id="image1" class="channelList div_1_1"></div> <div class="rowSubPgm"> <div id="programe1" class="pgmFirstRow div_1_2"></div> <div id="programe2" class="pgmFirstRow div_1_3"></div> <div id="programe3" class="pgmFirstRow div_1_4"></div> </div> </div> <div class="clear"></div> <div class="row" id="row2"> <div id="image2" class="channelList div_2_1"></div> <div class="rowSubPgm"> <div id="programe4" class="pgmFirstRow div_2_2"></div> <div id="programe5" class="pgmFirstRow div_2_3"></div> <div id="programe6" class="pgmFirstRow div_2_4"></div> </div> </div> <div class="clear"></div> <div class="row" id="row3"> <div id="image3" class="channelList div_3_1"></div> <div class="rowSubPgm"> <div id="programe7" class="pgmFirstRow div_3_2"></div> <div id="programe8" class="pgmFirstRow div_3_3"></div> <div id="programe9" class="pgmFirstRow div_3_4"></div> </div> </div> <div class="clear"></div> <div class="row" id="row4"> <div id="image4" class="channelList div_4_1"></div> <div class="rowSubPgm"> <div id="programe10" class="pgmFirstRow div_4_2"></div> <div id="programe11" class="pgmFirstRow div_4_3"></div> <div id="programe12" class="pgmFirstRow div_4_4"></div> </div> </div> <div class="clear"></div> <div class="row" id="row5"> <div id="image5" class="channelList div_5_1"></div> <div class="rowSubPgm"> <div id="programe13" class="pgmFirstRow div_5_2"></div> <div id="programe14" class="pgmFirstRow div_5_3"></div> <div id="programe15" class="pgmFirstRow div_5_4"></div> </div> </div> <div class="clear"></div> <div class="row" id="row6"> <div id="image6" class="channelList div_6_1"></div> <div class="rowSubPgm"> <div id="programe16" class="pgmFirstRow div_6_2"></div> <div id="programe17" class="pgmFirstRow div_6_3"></div> <div id="programe18" class="pgmFirstRow div_6_4"></div> </div> </div> <div class="clear"></div> <div class="row" id="row7"> <div id="image7" class="channelList div_7_1"></div> <div class="rowSubPgm"> <div id="programe19" class="pgmFirstRow div_7_2"></div> <div id="programe20" class="pgmFirstRow div_7_3"></div> <div id="programe21" class="pgmFirstRow div_7_4"></div> </div> </div> <div class="clear"></div> <div class="row" id="row8"> <div id="image8" class="channelList div_8_1"></div> <div class="rowSubPgm"> <div id="programe22" class="pgmFirstRow div_8_2"></div> <div id="programe23" class="pgmFirstRow div_8_3"></div> <div id="programe24" class="pgmFirstRow div_8_4"></div> </div> </div> <div class="clear"></div> I can output the unlimited rows from mysql without have any problem, but I cannot display more than 8 boxes for div classes. If I want to create the classes, I would have to change the last number in each line at the end, e.g: pgmFirstRow div_9_4, pgmFirstRow div_10_4 and so on. I am going to store thousand of rows in mysql and I find that it would be too much for me to work it on to add thousand lines of codes for add div classes. Does anyone know how to create the code to allow me to add unlimited number of div classes using with the arrays for the totalrowcount to match the rows that I store in mysql to allow me to add any range of boxes for div classes?? Any advice would be much appreciated. Thanks in advance