drums Posted September 7, 2007 Share Posted September 7, 2007 I have posted this question elsewhere and have not gottn the help to get this working. I hired someone to do this for a client and I'm now trying to apply it to another site for populating a calendar. Basically it's a MySQL dB that reads the data from an excel (csv) spreadsheet. I am not getting any errors (except in MySQL it says I don't have an index) but no data is going through. The php is being parsed through html. Calendar The csv file has a header row of date, month, Day1-31 and 2 notes fields. Yet nothing displays Does anyone have any ideas what I'm doing wrong? dB is here: http://1leachfamily.com/cabin.csv file And you can see it's going in by looking here:http://1leachfamily.com/xls/view.php <?php $page_title = "Cayucos Cabin Calendar "; $url=$_SERVER['PHP_SELF']; mysql_connect("localhost","xxx","xxx") or die("Error Connecting to server ".mysql_error()); mysql_select_db("xxx") or die("Error Connecting to db : ".mysql_error()); ?> <HTML lang="en-us"> <HEAD> <TITLE><?php echo $page_title ?> ~ August</TITLE> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <meta http-equiv="Content-Language" content="en-us"> <meta http-equiv="Expires" content="never"> <noscript> JavaScript must be enabled on your web browser to navigate this web site. </noscript> </head> <? $query=mysql_query("select * from xlsdata where year='2007' and month='August'"); while($record=mysql_fetch_array($query)) { $yearname = $record['year']; $monthname = $record['month']; $day1name = $record['day1']; $day2name = $record['day2']; $day3name = $record['day3']; $day4name = $record['day4']; $day5name = $record['day5']; $day6name = $record['day6']; $day7name = $record['day7']; $day8name = $record['day8']; $day9name = $record['day9']; $day10name = $record['day10']; $day11name = $record['day11']; $day12name = $record['day12']; $day13name = $record['day13']; $day14name = $record['day14']; $day15name = $record['day15']; $day16name = $record['day16']; $day17name = $record['day17']; $day18name = $record['day18']; $day19name = $record['day19']; $day20name = $record['day20']; $day21name = $record['day21']; $day22name = $record['day22']; $day23name = $record['day23']; $day24name = $record['day24']; $day25name = $record['day25']; $day26name = $record['day26']; $day27name = $record['day27']; $day28name = $record['day28']; $day29name = $record['day29']; $day30name = $record['day30']; $day31name = $record['day31']; $note1name = $record['note1']; $note2name = $record['note2']; } ?> <BODY background="images/baseball_bg.jpg" bgproperties="fixed" class="grnbars"> <TABLE align="center" cellpadding="0" cellspacing="0" width="740" border="0"> <tr> <td> <TABLE width="10%" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#030165"> <tr> <td> <img src="images/cay_morro_sm.jpg" alt="Cayucos" width="200" height="87" border="0"> </td> </tr> </TABLE> <P> <TABLE width="10%" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#030165"> <tr> <td> <TABLE cellspacing=1 cellpadding=0 align="center" width="99%" border="0"> <tr> <td bgcolor="#EBF0FF" align="center" class="norm_text" nowrap> <?=$monthname?> <?=$yearname?> <?=$headingname?> </td> </tr> </TABLE> </td> </tr> </TABLE> <br> <TABLE cellpadding="0" cols="12" align="center" width="75%" border="0"> <tr> <td align="center" width="50" bgcolor="#030165"> <a href="10-07cal.htm"><span class="whtcapbg">Oct</span></a> </td> <td align="center" width="50" bgcolor="#030165"> <a href="11-07cal.htm"><span class="whtcapbg">Nov</span></a> </td> <td align="center" width="50" bgcolor="#030165"> <a href="12-07cal.htm"><span class="whtcapbg">Dec</span></a> </td> <td align="center" width="50" bgcolor="#030165"> <a href="1-08cal.htm"><span class="whtcapbg">Jan</span></a> </td> <td align="center" width="50" bgcolor="#030165"> <a href="2-08cal.htm"><span class="whtcapbg">Feb</span></a> </td> <td align="center" width="50" bgcolor="#030165"> <a href="3-08cal.htm"><span class="whtcapbg">Mar</span></a> </td> <td align="center" width="50" bgcolor="#030165"> <a href="4-08cal.htm"><span class="whtcapbg">Apr</span></a> </td> <td align="center" width="50" bgcolor="#030165"> <a href="5-08cal.htm"><span class="whtcapbg">May</span></a> </td> <td align="center" width="50" bgcolor="#030165"> <a href="6-08cal.htm"><span class="whtcapbg">Jun</span></a> </td> <td align="center" width="50" bgcolor="#030165"> <a href="7-08cal.htm"><span class="whtcapbg">July</span></a> </td> <td align="center" width="50" bgcolor="#030165"> <a href="8-08cal.htm"><span class="whtcapbg">Aug</span></a> </td> <td align="center" width="50" bgcolor="#030165"> <a href="9-08cal.htm"><span class="whtcapbg">Sep</span></a> </td> </tr> </TABLE> <!-- ++++++++++++++++++++++++++++++++++++++ --> <!-- --> <!-- Start the Days of the Week --> <!-- --> <!-- ++++++++++++++++++++++++++++++++++++++ --> <TABLE cellpadding='0' cols="7" align='center' width='75%' bgcolor='030165' border='0'> <tr bgcolor="#EBF0FF"> <td align="center" width="87" class="dblcapbg">SUN</td> <td align="center" width="87" class="dblcapbg">MON</td> <td align="center" width="87" class="dblcapbg">TUE</td> <td align="center" width="87" class="dblcapbg">WED</td> <td align="center" width="87" class="dblcapbg">THU</td> <td align="center" width="87" class="dblcapbg">FRI</td> <td align="center" width="87" class="dblcapbg">SAT</td> </tr> <tr align=left valign=top> <td width='87' class='h2' height='87' bgcolor='030165'> <!-- ++++++++++++++++++++++++++++++++++++++ --> <!-- --> <!-- Start Days of Week 1 --> <!-- --> <!-- ++++++++++++++++++++++++++++++++++++++ --> <!-- SUNDAY --> <strong> </strong> </td> <td width="87" class="reg_text" height="87" bgcolor="#030165"> <!-- MONDAY --> <strong> </strong> </td> <td width="87" class="reg_text" height="87" bgcolor="#030165"> <!-- TUESDAY --> <strong> </strong> </td> <td width='87' class="reg_text" height="87" bgcolor="#EBF0FF"> <!-- WEDNESDAY --> <strong>1</strong><br> <?=$day1name?> </td> <td width="87" class="reg_text" height="87" bgcolor="#EBF0FF"> <!-- THURSDAY --> <strong>2</strong><br> <?=$day2name?> </td> <td width="87" class="reg_text" height="87" bgcolor="#EBF0FF"> <!-- FRIDAY --> <strong>3</strong><br> <?=$day3name?> </td> <td width="87" class="reg_text" height="87" bgcolor="#EBF0FF"> <!-- SATURDAY --> <strong>4</strong><br> <?=$day4name?> </td> </tr> <tr valign="top"> <td width="87" class="reg_text" height="87" bgcolor="#EBF0FF"> <!-- ++++++++++++++++++++++++++++++++++++++ --> <!-- --> <!-- Start Days of Week 2 --> <!-- --> <!-- ++++++++++++++++++++++++++++++++++++++ --> <!-- SUNDAY --> <strong>5</strong><br> <?=$day5name?> </td> <td width="87" class="reg_text" height="87" bgcolor="#EBF0FF"> <!-- MONDAY --> <strong>6</strong><br> <?=$day6name?> </td> <td width="87" class="reg_text" height="87" bgcolor="#EBF0FF"> <!-- TUESDAY --> <strong>7</strong><br> <?=$day7name?> </td> <td width="87" class="reg_text" height="87" bgcolor="#EBF0FF"> <!-- WEDNESDAY --> <strong>8</strong><br> <?=$day8name?> </td> <td width="87" class="reg_text" height="87" bgcolor="#EBF0FF"> <!-- THURSDAY --> <strong>9</strong><br> <?=$day9name?> </td> <td width="87" class="reg_text" height="87" bgcolor="#EBF0FF"> <!-- FRIDAY --> <strong>10</strong><br> <?=$day10name?> </td> <td width="87" class="reg_text" height="87" bgcolor="#EBF0FF"> <!-- SATURDAY --> <strong>11</strong><br> <?=$day11name?> </td> </tr> <tr valign="top"> <td width="87" class="reg_text" height="87" bgcolor="#EBF0FF"> <!-- ++++++++++++++++++++++++++++++++++++++ --> <!-- --> <!-- Start Days of Week 3 --> <!-- --> <!-- ++++++++++++++++++++++++++++++++++++++ --> <!-- SUNDAY --> <strong>12</strong><br> <?=$day12name?> </td> <td width="87" class="reg_text" height="87" bgcolor="#EBF0FF"> <!-- MONDAY --> <strong>13</strong><br> <?=$day13name?> </td> <td width="87" class="reg_text" height="87" bgcolor="#EBF0FF"> <!-- TUESDAY --> <strong>14</strong><br> <?=$day14name?> </td> <td width="87" class="reg_text" height="87" bgcolor="#EBF0FF"> <!-- WEDNESDAY --> <strong>15</strong><br> <?=$day15name?> </td> <td width="87" class="reg_text" height="87" bgcolor="#EBF0FF"> <!-- THURSDAY --> <strong>16</strong><br> <?=$day16name?> </td> <td width="87" class="reg_text" height="87" bgcolor="#EBF0FF"> <!-- FRIDAY --> <strong>17</strong><br> <?=$day17name?> </td> <td width="87" class="reg_text" height="87" bgcolor="#EBF0FF"> <!-- SATURDAY --> <strong>18</strong><br> <?=$day18name?> </td> </tr> <tr valign="top"> <td width="87" class="reg_text" height="87" bgcolor="#EBF0FF"> <!-- ++++++++++++++++++++++++++++++++++++++ --> <!-- --> <!-- Start Days of Week 4 --> <!-- --> <!-- ++++++++++++++++++++++++++++++++++++++ --> <!-- SUNDAY --> <strong>19</strong><br> <?=$day19name?> </td> <td width="87" class="reg_text" height="87" bgcolor="#EBF0FF"> <!-- MONDAY --> <strong>20</strong><br> <?=$day20name?> </td> <td width="87" class="reg_text" height="87" bgcolor="#EBF0FF"> <!-- TUESDAY --> <strong>21</strong><br> <?=$day21name?> </td> <td width="87" class="reg_text" height="87" bgcolor="#EBF0FF"> <!-- WEDNESDAY --> <strong>22</strong><br> <?=$day22name?> </td> <td width="87" class="reg_text" height="87" bgcolor="#EBF0FF"> <!-- THURSDAY --> <strong>23</strong><br> <?=$day23name?> </td> <td width="87" class="reg_text" height="87" bgcolor="#EBF0FF"> <!-- FRIDAY --> <strong>24</strong><br> <?=$day24name?> </td> <td width="87" class="reg_text" height="87" bgcolor="#EBF0FF"> <!-- SATURDAY --> <strong>25</strong><br> <?=$day25name?> </td> </tr> <tr valign="top"> <td width="87" class="reg_text" height="87" bgcolor="#EBF0FF"> <!-- ++++++++++++++++++++++++++++++++++++++ --> <!-- --> <!-- Start Days of Week 5 --> <!-- --> <!-- ++++++++++++++++++++++++++++++++++++++ --> <!-- SUNDAY --> <strong>26</strong><br> <?=$day26name?> </td> <td width="87" class="reg_text" height="87" bgcolor="#EBF0FF"> <!-- MONDAY --> <strong>27</strong><br> <?=$day27name?> </td> <td width="87" class="reg_text" height="87" bgcolor="#EBF0FF"> <!-- TUESDAY --> <strong>28</strong><br> <?=$day28name?> </td> <td width="87" class="reg_text" height="87" bgcolor="#EBF0FF"> <!-- WEDNESDAY --> <strong>29</strong><br> <?=$day29name?> </td> <td width="87" class="reg_text" height="87" bgcolor="#EBF0FF"> <!-- THURSDAY --> <strong>30</strong><br> <?=$day30name?> </td> <td width="87" class="reg_text" height="87" bgcolor="#EBF0FF"> <!-- FRIDAY --> <strong>31</strong><br> <?=$day31name?> </td> <td width="87" class="reg_text" height="87" > <!-- SATURDAY --> <strong></strong> <br> </td> </tr> </TABLE> <script language="JavaScript1.2" src="footerclose.js"></script> </td> </tr> </TABLE> </body> </html> Any help is greatly appreciated Quote Link to comment Share on other sites More sharing options...
gerkintrigg Posted September 7, 2007 Share Posted September 7, 2007 change the MySQL database structure using either PHP myAdmin or raw code and add an auto-increment index to the table. Without it, MySQL may not accept the data. (just a guess though as I've not populated from CSVs for over 18 months). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.