
cjkeane
Members-
Posts
63 -
Joined
-
Last visited
Profile Information
-
Gender
Not Telling
cjkeane's Achievements

Member (2/5)
0
Reputation
-
I can't do that. The data has already been imported by someone else and merged with live data. I cannot do another import using LOAD DATA INFILE, if that's what you are asking.
-
the db collation is: utf8_unicode_ci on each php page I have the following: <?php mysql_query("SET NAMES 'utf-8'"); ?> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> As I said, any new data saved via php into the mysql db retains the accented characters. It's just retrieving data (for e.g. first_name) which was imported from a csv into the mysql db which isn't displaying the accented characters correctly.
-
Hi everyone, I'm sure you all have come across this issue before, and I have read a lot of posts regarding it, but I have only been able to partially resolve my issue. I have a mysql database and I'm using php to retrieve the data. I imported data from a csv into mysql and all entries which have accented characters have been mangled and appear as: �. When text is entered with accented characters and saved using php into the mysql db, the characters retain the accented characters. I'm wondering if anyone would know how to write code to check if a string e.g. (first_name) is utf-8, if not then utf-8 decode it? I believe that would solve my issue. Or if anyone else has any suggestions which might help, I'd appreciate it. Also, sometimes I notice a � will appear between lines of text when it should have been a line break. If anyone could suggest a solution to those issues, I'd appreaciate it. Thanks.
-
i resolved it by using: preg_replace('/(\d\d)\/(\d\d)\/(\d\d\d\d)/', '<br>$0', $row['History']) thanks for the tip!
-
it's getting closer, but now it displays as: 01/08/2007 this is the first line of text 01/04/2007 this is the second line of text 01/04/2007 this is the third line of text
-
I have tried your suggestion and it still comes out as: 01/08/2007 this is the first line of text 01/04/2007 this is the second line of text 01/04/2007 this is the third line of text
-
Yes, that's exactly what the field contains. It was actually imported from another db into mysql in that fashion, so the entire field contains that entire string. I know it would have been better to have the date in a completely separate field, but there was nothing I could do about how the data was previosly imported. All I want to do is line up the data so that each date is underneath each other. I hope that makes sense.
-
I'm sure there aren't any line breaks. If I display the data, it comes out word wrapped, like so: 01/08/2007 this is the first line of text 01/04/2007 this is the second line of text 01/04/2007 this is the third line of text I need to some how insert a CR before each date so it lines up.
-
Hi everyone, i am retrieving data from mysql and displaying it in a table using the below coding. In the field string of $row['History'] there is a date followed by a description. This is how the data was inserted by the client previously. What I'd like to do is insert a CR just before the dd/mm/yyyy of each entry within the string. <?php $ID = $_GET['ID']; $result = mysql_query("SELECT ID, History FROM historytable WHERE ID='$ID'") or die(mysql_error()); echo "<table border='0' cellpadding='1'>"; echo "<tr>"; while($row = mysql_fetch_array( $result )) { echo "<tr>"; echo '<td>' . preg_replace('/\d\d\//', '<br>$0', $row['History']). '</td>'; echo "</tr>"; } echo "</table>"; ?> currently it's being displayed like so: 01/ 08/2007 this is the first line of text 01/ 04/2007 this is the second line of text 01/ 04/2007 this is the third line of text but i need it to be displayed like this. 01/08/2007 this is the first line of text 01/04/2007 this is the second line of text 01/04/2007 this is the third line of text Any assistance would be appreciated. Thanks.
-
i see the problem. thanks for the hint. i got the date sorting properly now. i do have another issue though. when data for the sender is imported, it goes in the db as john smith <[email protected]> when the data is displayed on the page it just displays as john smith with no email address. the datatype for the sender is varchar(200) latin1_swedish_ci. do i need to use php to convert the 'sender' field to include htmlspecial chars? i'm not quite sure which php function to use to display the entire contents of 'sender'. any ideas?
-
i duplicated the message by mistake instead of editing it.
-
hi everyone. i have a database storing emails with the following fields: date, subject. sender, format, toaddress. the date field is a varchar datatype which takes dates in as 'dd mmm, time'. i'd like to convert that to dd-mmm using php when i display the data on a page. I'm not sure which function can convert varchar data to a date so any helpful hints you can provide would be appreciated. i'm using the following code to display the results of the query to the page: whether i sort date ASC or date DESC, the order of the date column doesn't sort properly <?php $string = "SELECT id, date, substr(subject,1,20) as subject, sender, format, toaddress FROM email ORDER BY date ASC"; $query = mysql_query($string) or die (mysql_error()); $num_rows = mysql_num_rows($query); if($num_rows>0) { $pages = new Paginator; $pages->items_total = $num_rows; $pages->paginate(); echo $pages->display_pages(); echo $pages->display_items_per_page(); echo '<hr>'; } else { echo "<div id='titles_smaller'>No data available.</div><br />"; } echo "<table class='sortable' width='100%' border='0' cellpadding='1'>"; echo "<tr> <th nowrap>Date</th> <th nowrap>Subject (partial)</th><th nowrap>Sender</th><th nowrap>Format</th><th nowrap>To Address</th></tr>"; $string = $string."$pages->limit"; $query = mysql_query($string) or die (mysql_error()); $result = mysql_fetch_array($query); if($result==true) { do { echo "<tr>"; echo '<td nowrap>' . $result['date'] . '</td>'; echo '<td nowrap>' . $result['subject'] . '</td>'; echo '<td nowrap>' . $result['sender'] . '</td>'; echo '<td nowrap>' . $result['format'] . '</td>'; echo '<td nowrap>' . $result['toaddress'] . '</td>'; echo "</tr>"; } while($result = mysql_fetch_array($query)); } // close table> echo "</table><hr>"; if($num_rows>0) { echo $pages->display_pages().$pages->display_items_per_page(); } // end pagination ?>
-
hi everyone. i need to figure out how to display one tr or another based on if N/A appears in one of the TR's. if i use: 'if ($result['NoChargeFile'] = 'N/A')' it repeats N/A for all rows. if i use: 'if ($result['NoChargeFile'] = N/A)' only the TotalFees TR is displays. What i need to do is display the TOTALFEES if the NOCHARGEFILE is not N/A. If NOCHARGEFILE is N/A, display N/A instead of the TOTALFEES. Any ideas how to fix this issue? thanks. <?php echo "<table width='100%' border='0' cellpadding='1'>"; $string = $string."$pages->limit"; $query = mysql_query($string) or die (mysql_error()); $result = mysql_fetch_array($query); if($result==true) { do { echo "<tr>"; echo '<td nowrap>' . $result['CompanyName'] . '</td>'; echo '<td nowrap>' . $result['CompanyReferenceNumber'] . '</td>'; if ($result['NoChargeFile'] = 'N/A') { echo '<td nowrap>' . $result['NoChargeFile'] . '</td>'; } else { echo '<td nowrap>' . $result['TotalFees'] . '</td>'; } echo '<td nowrap>' . $result['DateRecorded'] . '</td>'; echo '<td nowrap>' . $result['DateClosed'] . '</td>'; echo "</tr>"; } while($result = mysql_fetch_array($query)); } // close table> echo "</table><hr>"; ?> I figured it out. i need == not =.
-
already tried that, plus many different variations of javascript refreshes of the parent window. i just tried <?php session_start(); $_SESSION['ID'] = $_GET['ID']; $ID = session_id(); ?> in the main page and in the iframe <?php $ID = $_REQUEST['ID'] ; if(session_id() == "") { session_id($ID); session_start(); echo "<br> sessId: " . $ID . "<br>" ; } ?> The id is displayed in the iframe, but as soon as the iframe is updated through a submit button, then i lose the session ID. the only way to get the ID back is for the whole page to be refreshed, but then when files are deleted from inside the iframe, the data sometimes doesnt delete. which is why i wanted to try using sessions.
-
I was attempting to use session variables because hopefully that way i wouldn't lose the ID number passed from the main page to the iframe. you see, in the iframe, there is a submit form with a list of files that can be deleted, and when the file is deleted, the link between the main page and the iframe is broken. i need a way to maintain the link between the main page and the iframe after the data is updated in the iframe. i hope that makes sense. ADDED NOT: The way it functions now, the page needs to be refreshed manually so that the iframe data is refreshed. i'd like not to have to keep refreshing the page manually.