harristweed
Members-
Posts
346 -
Joined
-
Last visited
-
Days Won
1
Everything posted by harristweed
-
Parse XML - Write to a database --- PLEASE HELP!
harristweed replied to maros174's topic in PHP Coding Help
I think the problem is this line in XML.class.php while ($file_content = fread($fp, 4096)) { Best option ditch the class and write a custom parser using php5 and simplexml_load_file Else you could try altering the line to while ($file_content = fread($fp, 10000)) { or/and line 69 $reference[$name][$this->_levelsNumbering[$i][$name]] =$reference[$name][$this->_levelsNumbering[$i][$name]]. $data; -
Correct order for Sizes in mysql (Feet & Inches)
harristweed replied to janglijagga's topic in PHP Coding Help
mysql_query("SELECT * FROM tblname ORDER BY Feet1 DESC, Inch1 DESC, Feet2 DESC, Inch2 DESC"); -
two things...first feed dosn't validate, that will break the parser... http://validator.w3.org/feed/check.cgi?url=http%3A%2F%2Fwww.newsday.co.tt%2Frss.xml Sorry This feed does not validate. * 'ascii' codec can't decode byte 0x93 in position 1801: ordinal not in range(128) (maybe a high-bit character?) [help] In addition, interoperability with the widest range of feed readers could be improved by implementing the following recommendations. * line 38, column 170: description contains bad characters (7 occurrences) [help] ... g to any of the floors in the building. ?Nobody is allowed to go upstair ... ^ * line 67, column 0: Missing atom:link with rel="self" [help] and secondly, why not parse it the easy way... $xml_feed="http://www.newsday.co.tt/rss.xml"; if(!$xml = simplexml_load_file("$xml_feed")){ $message.="Can't connect to feed $xml_feed"; } foreach ($xml->channel->item as $value){ $title=$value->title; $description=$value->description; echo"<p>$title</p>\n"; echo"<p>$description</p>\n"; }
-
why not just link to the file? or is that too easy?
-
email attachments are a nightmare! Why not email a download link?
-
jskywalker got there first.... $string="blaa\tblaa\t12345\tblaa\t*more tabs here*\n"; $length=strlen($string); $string_no_n=substr($string,0,($length-2)); $more_tabs="\t\t\t\n"; $new_string=$string_no_n.$more_tabs;
-
Retrieve mySql field that contains comma-separated list
harristweed replied to mainstreetop's topic in PHP Coding Help
Kind thought but not necessary. Glad to help. -
Retrieve mySql field that contains comma-separated list
harristweed replied to mainstreetop's topic in PHP Coding Help
Sure, would you like me to write the solution on a $100 bill and post it to you? -
Retrieve mySql field that contains comma-separated list
harristweed replied to mainstreetop's topic in PHP Coding Help
foreach ($jpg_array as $path) { echo "<a><img src='http://www.website.com/images/" . $path . " '></a>"; } -
I can't see where you are using $i in the loop content. Something in the loop must be terminating the for loop. Do you get any error messages? ini_set('error_reporting', E_ALL); ini_set('display_errors', 'On');
-
Are you sure you are connecting to the database? Do you get any error messages ? ini_set('error_reporting', E_ALL); ini_set('display_errors', 'On');
-
Retrieve mySql field that contains comma-separated list
harristweed replied to mainstreetop's topic in PHP Coding Help
Possibly... while ($row = mysql_fetch_assoc($result)) { $jpg_array=explode(",",$row['ItemImage']); foreach ($jpg_array as $key => $value) { echo" $key = $value<br />\n";//or whatever you are doing with the results... } } -
Retrieve mySql field that contains comma-separated list
harristweed replied to mainstreetop's topic in PHP Coding Help
$Image="1.jpg,2.jpg,3.jpg"; $jpg_array=explode(",",$Image); foreach ($jpg_array as $key => $value) { echo" $key = $value<br />\n"; } -
whats in the loop?
-
<?php header('location: ../index.php'); ?>
-
Quick Question regarding uploading image paths to an sql DB
harristweed replied to svgmx5's topic in PHP Coding Help
http://www.google.co.uk/search?hl=en&source=hp&q=php+image+upload+script&meta=&aq=0&oq=php+image+upload -
change line 107 from EOD; to EOD ;
-
send_mail.php?id='.$id.' email='.$row['email']. perhaps should be: send_mail.php?id='.$id.'&email='.$row['email'].
-
missed of the braces doh!!! if(!mysql_query($update,$link_id)) { $error=mysql_error(); echo $error; }
-
where is the update run? mysql_select_db("XXXXX")or die("cannot select DB"); [color=red]"UPDATE qls3_users SET group_id = '9' WHERE $payer_email = 'email'";[/color] <<<< THIS IS THE BIT THAT DONT SEEM TO WORK /* END EDITABLE AREA ------------ */ header("location:undefined"); exit; I can't see that you have even connected to the database! $link_id=mysql_connect("localhost", "XXXXX", "XXXXX")or die("cannot connect"); mysql_select_db("XXXXX")or die("cannot select DB"); $update="UPDATE qls3_users SET group_id = '9' WHERE email = '$payer_email'"; if(!mysql_query($update,$link_id)) $error=mysql_error(); echo $error; // or add to email or wherever you want to show it /* END EDITABLE AREA ------------ */ header("location:undefined"); exit;
-
Payer email wont ='emal' It might = $payer_email UPDATE qls3_users SET group_id = '9' WHERE email = '$payer_email'
-
thank you
-
<?php $date_today=date("l jS M Y"); echo $date_today."<br />\n"; $day_1 = mktime(0, 0, 0, date("m"), date("d")+1, date("Y")); $day1=date("l jS M Y",$day_1); echo $day1."<br />\n"; $day_2 = mktime(0, 0, 0, date("m"), date("d")+2, date("Y")); $day2=date("l jS M Y",$day_2); echo $day2."<br />\n"; echo"....<br />\n"; $day_9 = mktime(0, 0, 0, date("m"), date("d")+9, date("Y")); $day9=date("l jS M Y",$day_9); echo $day9."<br />\n"; ?>
-
I have a new job which is updating a site which was written using Symfony . I have had a brief look at the documentation for Symfony and I’m wondering if going through the pain barrier of learning all about Symfony is worth the effort. Apart from the nightmare of trying to Symfony get it installed on my system. My question is it worth trying to install, learn Symfony for one not very well paid job?
-
try converting '<?' to '<?php'