Jump to content

Greywacke

Members
  • Posts

    510
  • Joined

  • Last visited

Everything posted by Greywacke

  1. well yes, as a matter of fact i tried using htmlspecialchars at first. the only named entities valid XML 1.0 supports is &, " > and <. the rest of the entities need to be hex based NCR's (eg. ÿ), dec based NCR's (eg. Ā) are not supported. :)the header code is implemented like that, except there is a space before charset after the semi-colon...
  2. okay temporarily repaired this line with the following $value = str_replace(array("&","<",">","\"","ë","è","é","“","”"), array("&","<",">",""","ë","è","é","“","”"), $value); can't seem to locate any decent examples, but i still need to do a PCRE preg_replace to replace the first four invalid ascii characters (&, <, >, "), as well as any utf-8 character and any unicode character (with the hexadecimal NCR), while i wait for the utf-8 support on the server.detailed instructions on setting apache to use utf-8the first reference i found to setting up utf-8 as default character set
  3. hi all,you know i've got the problem with utf-8 characters in xml. the file encoding is all utf-8, and charsets of the form, and html pages as well as the xml pages have been set to utf-8 but i still get the problem with unicode characters. i am unable to change the PHP default encoding, so replacing the characters is the closest i can get.i am trying to run a preg_replace on the string to replace &, <, >, " as well as any unicode (non-ascii) characters with the relative hex numeric character reference (NCR), to write any string as valid xml attribute values.now i am not that familiar with regular expressions in PHP (PCRE), i can only seem to find reference to replacing NCR characters with the associated utf-8 character on the net.i need to do the reverse of this.this is what i've got sofar, but i know it's wrong - how can i fix this? $value = preg_replace(array("&","<",">","\"","/[^\x{0-255}]/ue"), array("&","<",">",""","/ord($0);/"), $value); please, will anyone point me in the right direction - this is of utmost urgence, and i am not sure what to do.i've started researching PCRE's (Perl Compatible Regular Expressions) for use with preg_replace, but sofar not found a solution for replacing unicode characters with their hex ncr's...
  4. what i am saying is:the same connection include file that works over the sites pages, generates these errors in the crontasks.is there a way to alternately reference them perhaps? should i refer to these two as $GLOBALS["sql"] and $GLOBALS["conn"] in the cronjob pages? these variables are available in the php pages down through includes, just not in the cronjobs. i'm not talking about session variables or superglobals - merely about the difference in referring to variables in a crontask php doc as opposed to a public webserved php document, these are two distinct crontasks, no "sharing" variables, except the ones within the include - they cascade down on the regular pages without errors. the connection include creates the connection and contains the mysql error handling function as well as mysql timezone setting for retrieval of dates to south african standard time.
  5. variables defined and set inside the connection include, as array and the connection (link). these warnings do not appear if the pages are called manually from a web browser, however - the following warnings are sent with the cronjobs, which otherwise execute as intended. basically the two variables defined in the connection include at the top of the page.php -q -f /virtual path to/cronjob_reminder.php <br /><b>Warning</b>: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Access denied for user 'dwtphovu_f3rr37y'@'localhost' (using password: YES) in <b>/home/dwtphovu/public_html/ferrety/fab/includes/content/dwtphovu_f3rr37y.php</b> on line <b>7</b><br /> <br /><b>Warning</b>: array_push() [<a href='function.array-push'>function.array-push</a>]: First argument should be an array in <b>/home/dwtphovu/public_html/ferrety/fab/includes/content/dwtphovu_f3rr37y.php</b> on line <b>10</b><br /> <br /><b>Warning</b>: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in <b>/home/dwtphovu/public_html/ferrety/fab/includes/content/dwtphovu_f3rr37y.php</b> on line <b>49</b><br /> <br /><b>Warning</b>: mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Access denied for user 'dwtphovu'@'localhost' (using password: NO) in <b>/home/dwtphovu/public_html/ferrety/fab/includes/content/dwtphovu_f3rr37y.php</b> on line <b>15</b><br /> <br /><b>Warning</b>: mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in <b>/home/dwtphovu/public_html/ferrety/fab/includes/content/dwtphovu_f3rr37y.php</b> on line <b>15</b><br /> <br /><b>Warning</b>: mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Access denied for user 'dwtphovu'@'localhost' (using password: NO) in <b>/home/dwtphovu/public_html/ferrety/fab/public/cronjob_reminder.php</b> on line <b>6</b><br /> <br /><b>Warning</b>: mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in <b>/home/dwtphovu/public_html/ferrety/fab/public/cronjob_reminder.php</b> on line <b>6</b><br /> <br /><b>Warning</b>: mysql_close(): supplied argument is not a valid MySQL-Link resource in <b>/home/dwtphovu/public_html/ferrety/fab/public/cronjob_reminder.php</b> on line <b>36</b><br /> php -q -f /virtual path to/cronjob_canopyxchange.php <br /><b>Warning</b>: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Access denied for user 'dwtphovu_f3rr37y'@'localhost' (using password: YES) in <b>/home/dwtphovu/public_html/ferrety/fab/includes/content/dwtphovu_f3rr37y.php</b> on line <b>7</b><br /> <br /><b>Warning</b>: array_push() [<a href='function.array-push'>function.array-push</a>]: First argument should be an array in <b>/home/dwtphovu/public_html/ferrety/fab/includes/content/dwtphovu_f3rr37y.php</b> on line <b>10</b><br /> <br /><b>Warning</b>: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in <b>/home/dwtphovu/public_html/ferrety/fab/includes/content/dwtphovu_f3rr37y.php</b> on line <b>49</b><br /> <br /><b>Warning</b>: mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Access denied for user 'dwtphovu'@'localhost' (using password: NO) in <b>/home/dwtphovu/public_html/ferrety/fab/includes/content/dwtphovu_f3rr37y.php</b> on line <b>15</b><br /> <br /><b>Warning</b>: mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in <b>/home/dwtphovu/public_html/ferrety/fab/includes/content/dwtphovu_f3rr37y.php</b> on line <b>15</b><br /> <br /><b>Warning</b>: mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Access denied for user 'dwtphovu'@'localhost' (using password: NO) in <b>/home/dwtphovu/public_html/ferrety/fab/public/cronjob_canopyxchange.php</b> on line <b>6</b><br /> <br /><b>Warning</b>: mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in <b>/home/dwtphovu/public_html/ferrety/fab/public/cronjob_canopyxchange.php</b> on line <b>6</b><br /> <br /><b>Warning</b>: mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Access denied for user 'dwtphovu'@'localhost' (using password: NO) in <b>/home/dwtphovu/public_html/ferrety/fab/public/cronjob_canopyxchange.php</b> on line <b>40</b><br /> <br /><b>Warning</b>: mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in <b>/home/dwtphovu/public_html/ferrety/fab/public/cronjob_canopyxchange.php</b> on line <b>40</b><br /> <br /><b>Warning</b>: mysql_close(): supplied argument is not a valid MySQL-Link resource in <b>/home/dwtphovu/public_html/ferrety/fab/public/cronjob_canopyxchange.php</b> on line <b>72</b><br />
  6. hi all,i have set up cronjobs on cPanel X to execute the following php documents: cronjob_canopyxchange.php & cronjob_reminder.phpit executes the script, and sends the correct mails via PHPMailer, however it seems that variables are not persisted into the main page from the include.how could i enable this? in the cronjobs, the connection is a require_once and that the variables defined are not being persisted. however, this exact same include, in the rest of the site - persists the variables without warnings.how could i resolve this? i guess i would need to set the namespace of the cronjob - let me google on this solong...
  7. i believe that's because it's explorer integrated, ie inherits the execution rights of the parent window.i doubt you would be able to do this in internet explorer however. it's basically pc hijacking if a webpage can shut down or hybernate a pc.nevermind browser hijacking!
  8. ah the solution was EXISTS SELECT REPLACE(10_serviceprospects.text_LeadAttributes,'<br />','\r\n') AS `Lead Attributes`, SUBSTRING_INDEX(10_serviceprospects.text_Consumer,';',1) AS `Consumer Name`, SUBSTRING_INDEX(SUBSTRING_INDEX(10_serviceprospects.text_Consumer,';',2),';',-1) AS `Consumer E-mail`, SUBSTRING_INDEX(SUBSTRING_INDEX(10_serviceprospects.text_Consumer,';',3),';',-1) AS `Consumer Telephone`, 1_regions.text_RegionDescription AS `Consumer Region`, SUBSTRING_INDEX(10_serviceprospects.text_Consumer,';',-1) AS `Consumer City/Town`, 13_prospectleadsent.timestamp_Sent AS `Lead Created`, IF(EXISTS ( SELECT 13_prospectleadsent.bigint_ProspectID FROM 13_prospectleadsent WHERE 13_prospectleadsent.bigint_ProspectID = 10_serviceprospects.bigint_ProspectID ),'TRUE','FALSE') AS `Lead Sent`, 5_suppliers.text_SupplierName AS `Supplier`, 2_servicescatalogue.text_ServiceDescription AS `Service` FROM 10_serviceprospects LEFT JOIN 13_prospectleadsent ON ( 10_serviceprospects.bigint_ProspectID = 13_prospectleadsent.bigint_ProspectID) LEFT JOIN 1_regions ON ( 10_serviceprospects.bigint_RegionID = 1_regions.bigint_RegionID) LEFT JOIN 5_suppliers ON ( 13_prospectleadsent.bigint_SupplierID = 5_suppliers.bigint_SupplierID) LEFT JOIN 2_servicescatalogue ON ( 10_serviceprospects.bigint_ServiceID = 2_servicescatalogue.bigint_ServiceID) ORDER BY `Lead Created` DESC; this query is now ready for CSV export
  9. okay have finished the prospecting leads select statement: SELECT REPLACE(10_serviceprospects.text_LeadAttributes,'<br />','\r\n') AS `Lead Attributes`, SUBSTRING_INDEX(10_serviceprospects.text_Consumer,';',1) AS `Consumer Name`, SUBSTRING_INDEX(SUBSTRING_INDEX(10_serviceprospects.text_Consumer,';',2),';',-1) AS `Consumer E-mail`, SUBSTRING_INDEX(SUBSTRING_INDEX(10_serviceprospects.text_Consumer,';',3),';',-1) AS `Consumer Telephone`, 1_regions.text_RegionDescription AS `Consumer Region`, SUBSTRING_INDEX(10_serviceprospects.text_Consumer,';',-1) AS `Consumer City/Town`, 13_prospectleadsent.timestamp_Sent AS `Lead Created`, IF(( SELECT 13_prospectleadsent.bigint_ProspectID FROM 13_prospectleadsent WHERE 13_prospectleadsent.bigint_ProspectID = 10_serviceprospects.bigint_ProspectID ) > 0,'TRUE','FALSE') AS `Lead Sent`, 5_suppliers.text_SupplierName AS `Supplier`, 2_servicescatalogue.text_ServiceDescription AS `Service` FROM 10_serviceprospects LEFT JOIN 13_prospectleadsent ON ( 10_serviceprospects.bigint_ProspectID = 13_prospectleadsent.bigint_ProspectID) LEFT JOIN 1_regions ON ( 10_serviceprospects.bigint_RegionID = 1_regions.bigint_RegionID) LEFT JOIN 5_suppliers ON ( 13_prospectleadsent.bigint_SupplierID = 5_suppliers.bigint_SupplierID) LEFT JOIN 2_servicescatalogue ON ( 10_serviceprospects.bigint_ServiceID = 2_servicescatalogue.bigint_ServiceID) ORDER BY `Lead Created` DESC; but PMA returns the following error: now why would this be? this table is specified on a LEFT JOIN...the field names were made more readable for the nonsql people, in the active leads selection statement too - as here.why would this statement not be joining the 2_servicescatalogue table?
  10. well duh. lol the problem was a } instead of a ) by accident :)here is the working code ^^ SELECT SUBSTRING_INDEX(6_serviceleads.text_Consumer,';',1) AS text_ConsumerName, SUBSTRING_INDEX(SUBSTRING_INDEX(6_serviceleads.text_Consumer,';',2),';',-1) AS `text_ConsumerE-mail`, SUBSTRING_INDEX(SUBSTRING_INDEX(6_serviceleads.text_Consumer,';',3),';',-1) AS text_ConsumerTel, 1_regions.text_RegionDescription AS text_ConsumerRegion, SUBSTRING_INDEX(6_serviceleads.text_Consumer,';',-1) AS text_ConsumerCityTown, 6_serviceleads.timestamp_LeadCreated, IF(6_serviceleads.tinyint_LeadSent = 1,'TRUE','FALSE') AS boolean_LeadSent, REPLACE(6_serviceleads.text_LeadAttributes,'<br />','\r\n') AS text_LeadAttributes, 5_suppliers.text_SupplierName, 2_servicescatalogue.text_ServiceDescription FROM 6_serviceleads LEFT JOIN 1_regions ON ( 6_serviceleads.bigint_RegionID = 1_regions.bigint_RegionID) LEFT JOIN 5_suppliers ON ( 6_serviceleads.bigint_SupplierID = 5_suppliers.bigint_SupplierID) LEFT JOIN 2_servicescatalogue ON ( 6_serviceleads.bigint_ServiceID = 2_servicescatalogue.bigint_ServiceID) ORDER BY text_ConsumerName ASC; issue is RESOLVED!! (776 records returned) 8Dnow to do the prospecting leads as opposed to the active leads... 0o
  11. okay, thanks justsomeguy - the statement looks as follows: SELECT SUBSTRING_INDEX(6_serviceleads.text_Consumer,';',1) AS text_ConsumerName, SUBSTRING_INDEX(SUBSTRING_INDEX(6_serviceleads.text_Consumer,';',2),';',-1) AS `text_ConsumerE-mail`, SUBSTRING_INDEX(SUBSTRING_INDEX(6_serviceleads.text_Consumer,';',3),';',-1) AS text_ConsumerTel, 1_regions.text_RegionDescription AS text_ConsumerRegion, SUBSTRING_INDEX(6_serviceleads.text_Consumer,';',-1) AS text_ConsumerCityTown, 6_serviceleads.timestamp_LeadCreated, IF(6_serviceleads.tinyint_LeadSent = 1,'TRUE','FALSE') AS boolean_LeadSent, REPLACE(6_serviceleads.text_LeadAttributes,'<br />','\r\n') AS text_LeadAttributes, 5_suppliers.text_SupplierName, 2_servicescatalogue.text_ServiceDescription FROM 6_serviceleads LEFT JOIN 1_regions ON ( 6_serviceleads.bigint_RegionID = 1_regions.bigint_RegionID) LEFT JOIN 5_suppliers ON ( 6_serviceleads.bigint_SupplierID = 5_suppliers.bigint_SupplierID} LEFT JOIN 2_servicescatalogue ON ( 6_serviceleads.bigint_ServiceID = 2_servicescatalogue.bigint_ServiceID) ORDER BY text_ConsumerName ASC; unfortunately PMA reports the following:
  12. okay this is the sql query i have sofar, to be exported as CSV through PMA. SELECT SUBSTRING_INDEX(6_serviceleads.text_Consumer,';',1) AS text_ConsumerName, SUBSTRING_INDEX(SUBSTRING_INDEX(6_serviceleads.text_Consumer,';',2),';',-1) AS `text_ConsumerE-mail`, SUBSTRING_INDEX(SUBSTRING_INDEX(6_serviceleads.text_Consumer,';',3),';',-1) AS text_ConsumerTel, 1_regions.text_RegionDescription AS text_ConsumerRegion, SUBSTRING_INDEX(6_serviceleads.text_Consumer,';',-1) AS text_ConsumerCityTown, 5_serviceleads.timestamp_LeadCreated, UNKNOWN_FUNCTION(6_serviceleads.tinyint_LeadSent) AS boolean_LeadSent, REPLACE(6_serviceleads.text_LeadAttributes,'<br />','\r\n') AS text_LeadAttributes, 5_suppliers.text_SupplierName, 2_servicescatalogue.text_ServiceDescriptionFROM 6_serviceleads LEFT JOIN 1_regions ON ( 6_serviceleads.bigint_RegionID = 1_regions.bigint_RegionID) LEFT JOIN 5_suppliers ON ( 6_serviceleads.bigint_SupplierID = 5_suppliers.bigint_SupplierID} LEFT JOIN 2_servicescatalogue ON ( 6_serviceleads.bigint_ServiceID = 2_servicescatalogue.bigint_ServiceID) ORDER BY text_ConsumerName ASC; i would now like to know which function should i use to convert the tinyint values (either 0 or 1) to "TRUE" or "FALSE" for this select.anybody know? i've searched myself moeg and i cannot find much except for useless essays on mysql only supporting tinyint and not boolean values, tinyint vs enum('true', 'false') etc.i searched for MYSQL tinyint to boolean amongst others... :/
  13. okay nevermind :)lol i just had to do a double SUBSTRING_INDEX on some of values: SELECT SUBSTRING_INDEX(6_serviceleads.text_Consumer,';',1) AS text_ConsumerName, SUBSTRING_INDEX(SUBSTRING_INDEX(6_serviceleads.text_Consumer,';',2),';',-1) AS `text_ConsumerE-mail`, SUBSTRING_INDEX(SUBSTRING_INDEX(6_serviceleads.text_Consumer,';',3),';',-1) AS text_ConsumerTel, SUBSTRING_INDEX(6_serviceleads.text_Consumer,';',-1) AS text_ConsumerCityTown FROM 6_serviceleads ORDER BY text_ConsumerName ASC; this issue has now been resolved
  14. hi all,i've got a semicolon delimited text_Consumer field in the table 6_serviceleads.this field contains the user information, delimited by ; eg: Zubair Vally;zubair.vally@gijima.com;012 675 7548;Cape Town all the fields have these values: the consumer's name, the consumer's e-mail, the consumer's telephone number and the consumer's city / town.i need to do something like follows: SELECT SUBSTRING_INDEX(6_serviceleads.text_Consumer,';',0) AS text_ConsumerName, SUBSTRING_INDEX(6_serviceleads.text_Consumer,';',1) AS `text_ConsumerE-mail`, SUBSTRING_INDEX(6_serviceleads.text_Consumer,';',2) AS text_ConsumerTel, SUBSTRING_INDEX(6_serviceleads.text_Consumer,';',3) AS text_ConsumerCityTown FROM 6_serviceleads ORDER BY text_ConsumerName ASC; but i know this would not work (this is not how SUBSTRING_INDEX works), i can't seem to find any reference for a "split" function in mysql. :/please help with this!
  15. oh nevermind, lol the attribute retrieval code was deprecated. $attr = split("<br />",$row1["text_LeadAttributes"]); it should be as follows: $attr = split("<br />",$row["text_LeadAttributes"]); issue resolved! :)a screenshot of the mail as intended can be viewed here.
  16. hi all,i've got a slight issue to resolve.i need to find out why the following function's code in bold is not returning the make/model/style, despite them being returned in another function. function gettransactions() { //= supplier id, >= from and <= to dates as available create constraints // ".(($numargs>0)?" WHERE ":"").join(" AND ",$arg_list)." $arr = array(); if ($GLOBALS["s"] > 0) { array_push($arr,"13_prospectleadsent.bigint_SupplierID = ".$GLOBALS["s"]); } array_push($arr,"13_prospectleadsent.timestamp_Sent >= \"".$GLOBALS["f"]."\""); array_push($arr,"13_prospectleadsent.timestamp_Sent <= \"".$GLOBALS["t"]."\""); $sql = "SELECT 10_serviceprospects.bigint_ProspectID, 13_prospectleadsent.smallint_ProspectOrdinal, 13_prospectleadsent.timestamp_Sent, 10_serviceprospects.text_LeadAttributes, 10_serviceprospects.text_Consumer, 1_regions.text_RegionDescription FROM 13_prospectleadsent LEFT JOIN 10_serviceprospects ON ( 13_prospectleadsent.bigint_ProspectID = 10_serviceprospects.bigint_ProspectID ) LEFT JOIN 1_regions ON ( 10_serviceprospects.bigint_RegionID = 1_regions.bigint_RegionID )". ((count($arr)>0)? " WHERE ".join(" AND ",$arr): ""). " ORDER BY 13_prospectleadsent.timestamp_Sent ASC;"; $result = mysql_query_errors($sql , $conn , __FILE__ , __LINE__ , false); if ($result) { while ($row = mysql_fetch_array($result)) {[b] $attr = split("<br />",$row1["text_LeadAttributes"]); $req = ""; $mak = ""; $stl = ""; foreach ($attr as $value) { $val = split(" = ",$value); if (stristr($val[0],"product")) { $req = trim($val[1]); } elseif (stristr($val[0],"make_model")) { $mak = trim($val[1]); } elseif (stristr($val[0],"style")) { $stl = trim($val[1]); } } if (strlen($req)==0) { $req = $mak." ".$stl; }[/b] $consumer = split(";",$row["text_Consumer"]);[color="#FF0000"] $ret .= "<div class=\"gw003\"><div class=\"leadid\">#". (intval($row["bigint_ProspectID"]) + 9001100)."-". $row["smallint_ProspectOrdinal"]. "</div><div class=\"timestamp\">".$row["timestamp_Sent"]. "</div><div class=\"makestyle\">".xmlentities([b]$req[/b]). " (".$row["text_RegionDescription"].", ".$consumer[3]. ")</div><div class=\"consumer\">". $consumer[0]." (".$consumer[1].")</div></div>\n";[/color] } } return $ret;} below is a link to a screenshot of what the mail looks like at the moment, with the missing make/model/style values:Received Mail Screenshot.the sql string selects the leads within the selected parameters/constraints, xmlentities merely replaces &, <, > and other characters with their html or numeric entities.however, $req = an empty string here, it is supposed to contain the same values as shown in the preview below (retrieved to xml with the same code, in another function).Mail Preview Screenshot.i've been through the sql statement, the code in bold that parses the attributes - and still get nothing.it is possible that the code in red is not properly formatted however.somebody please help!
  17. i still have to replace the left and right double quotes and accented characters though, despite the php files generating the xml being utf-8. the strings are pulled from a mysql database, with collation being found to be latin1_swedish_ci. converted to utf8_unicode_ci. did not work, still have to replace the unicode characters with xml entities as follows: function xmlentities($value) { if (is_array($value)) { foreach ($value as $key => $val) { $value[$key] = xmlentities($val); } } else { $value = str_replace('&', '&', $value); $value = str_replace('"', '"', $value); $value = str_replace('<', '<', $value); $value = str_replace('>', '>', $value); $value = str_replace('“', '“', $value); $value = str_replace('”', '”', $value); $value = str_replace('é', 'é', $value); } return $value;} would it help if the js files are utf-8, the form includes and all the php pages? that all the site's text files get saved as utf-8? javascript, css, html, php, etc. rather than just defining it in the meta-tags. this problem has arisen since the arise of firefox 3.6.3 - which i guess has a more intrinsic utf-8 unicode support.
  18. ahh the unicode characters defining it as utf-8 before the php... this screwed me around a bit no thanks to "unifier" lol...Unifier Websitethis issue is now resolved
  19. hi all,i am unable to set the header information before the first response characters are echoed.here is the start of the php script: <?php/*SIGN-UP MANAGER AJAX XML RESPONSEVersion 2.0.0~*/header("Content-type: text/xml; charset=utf-8");echo "<?xml version=\"1.0\" ?>\n";echo "<root>\n";//script is continued below... i receive the following error in mozilla firefox 3.6.3: how is this possible? 0o
  20. okay, from what i read - i can update it as follows: UPDATE 10_serviceprospects, 6_serviceleadsSET 10_serviceprospects.bigint_RegionID = 6_serviceleads.bigint_RegionID WHERE NOT EXISTS ( SELECT * FROM 1_regions WHERE 1_regions.bigint_RegionID = 10_serviceprospects.bigint_RegionID) AND 10_serviceprospects.text_Consumer = 6_serviceleads.text_Consumer; and 78 records' region id's were updated ^^this issue has now been resolved
  21. and i came up with this page, describing the different ways to do a CROSS TABLE UPDATE.let me go read solong ^^
  22. okay, tested and PMA responded as follows: let me google on updating mysql from a second table...
  23. hi all,me again... on mysql, i need to update records in table b to the values in table a - some regions were dropped from table c and are thus nonexistant causing many records to go unnoticed.i need to set the regions to the new regions now, but i am not completely sure of how the sql statement would look.sofar i have got: UPDATE 10_serviceprospects SET 10_serviceprospects.bigint_RegionID = 6_serviceleads.bigint_RegionID WHERE 10_serviceprospects.text_Consumer = 6_serviceleads.text_Consumer; i can manage to select the records with deprecated region id's simply by doing a query as follows: SELECT * FROM 10_serviceprospects WHERE NOT EXISTS ( SELECT * FROM 1_regions WHERE 1_regions.bigint_RegionID = 10_serviceprospects.bigint_RegionID); is it possible to merge these statements, so that the records which have valid id's are not even touched?something like follows: UPDATE 10_serviceprospects SET 10_serviceprospects.bigint_RegionID = 6_serviceleads.bigint_RegionID WHERE NOT EXISTS ( SELECT * FROM 1_regions WHERE 1_regions.bigint_RegionID = 10_serviceprospects.bigint_RegionID) AND 10_serviceprospects.text_Consumer = 6_serviceleads.text_Consumer; just wish to hear any comments - "negative" or "positive" (i don't live in a world of duality so i take comments as comments )...
  24. utf-8but i have found the entities to be displayed, and they display as the characters no longer that question mark in the square character.i just had to replace the left and right slanting double quotes with “ and ”.issue resolved!
  25. i've attempted following the recommendation in a kirupa forum post, but to no avail.even with the encoding set in the header, both the left and right double quotes are displayed as �. perhaps i need to replace them with the html entities?well this did not work. “ and ” are not recognised xml entities. neither do the characters want to display on a utf-8 encoded xml document. :/starting to lose my focus again, please help!
×
×
  • Create New...