Jump to content

MarkMan5

Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

MarkMan5's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. How can I uninstall MySQL-shared-standard? I tried: rpm -e MySQL-shared-standard-5.0.27-0.rhel4.i386.rpm and received the error: error: package MySQL-shared-standard-5.0.27-0.rhel4.i386.rpm is not installed but the files are installed and: rpm -qa | grep -i mysql outputted: MySQL-server-standard-5.0.27-0.rhel4 MySQL-client-standard-5.0.27-0.rhel4 php-mysql-5.0.2-1 MySQL-shared-standard-5.0.27-0.rhel4 I need to install the compat version and must first uninstall the standard version. Please help. Thanks in advance
  2. How can I uninstall MySQL-shared-standard? I need to install the compat version and must first uninstall the standard version, so as to get PHP to talk to MySQL. I tried: rpm -e MySQL-shared-standard-5.0.27-0.rhel4.i386.rpm and received the error: error: package MySQL-shared-standard-5.0.27-0.rhel4.i386.rpm is not installed but the files are installed and: rpm -qa | grep -i mysql outputted: MySQL-server-standard-5.0.27-0.rhel4 MySQL-client-standard-5.0.27-0.rhel4 php-mysql-5.0.2-1 MySQL-shared-standard-5.0.27-0.rhel4 Please help. Thanks in advance.
  3. Apologies for starting yet another discussion on this. I've been pulling my hair out trying to get this LAMP configured properly. Here is the server/app info: RedHat centOS 4.4, Apache 2, mysql 5.0 (server,client,shared), php 4.3.9, perl 5.8.5 I'm not able to access the MySQL db via php because commands such as 'mysql_connect' are not recognized. Running php -m indicates that the mysql module is not loaded. The php.ini file has been reviewed (as I've read so much about) to point to the correct extension directory and module, but there does not seem to be a "mysql.so" file installed to point to. So... how can I get the php mysql module installed and loaded? Any help would be greatly appreciated! Thanks in advance.
  4. For those interested, the solution is this: Add global variable $date1 to beginning of script and to lists of global variables in all functions.  Also change the variable in the endElement() function to be $date1 instead of $date .  See bold below for final change: function startElement($parser, $name, $attrs) { global $insideitem, $tag, $title, $description, $link, $date, [b]$date1[/b], $image, $insideimage; [b]if ($insideitem || $insideimage) { if ($name == "FS") {$date1 = $attrs["VALUE"];} else {$tag = $name;} } [/b] if ($name == "R" ) { $insideitem = true; } if ($name == "IMAGE") { $insideimage = true; } }
  5. I have modified a free third party php script to display an xml feed.  What I now need to do is display the date, which is an attribute of an element.    <FS NAME="date" VALUE="2006-05-11" />  How do I display the date?  The code is below.  Thanks in advance! [pre]<? //$headline_style = 'news'; $headline_style = ''; $description_style = ''; $feed_url = ''; $show_detail = false; $insideitem = false; $tag = ""; $title = ""; $date = ""; $description = ""; $link = ""; $image = ""; $insideimage = false; $max = 3; $count = 0; function render_news($feed_url, $showdetail, $headlinestyle, $detailstyle) { global $show_detail, $headline_style, $detail_style, $max, $count, $insideitem, $insideimage; $insideitem=false; $insideimage=false; $count = 0; $show_detail = $showdetail; $headline_style = $headlinestyle; $detail_style = $detailstyle; $xml_parser = xml_parser_create(); xml_set_element_handler($xml_parser, "startElement", "endElement"); xml_set_character_data_handler($xml_parser, "characterData"); $fp = @fopen($feed_url,"r")   or die("Error reading xml data."); if ($fp) { while ($data = fread($fp, 4096))   xml_parse($xml_parser, $data, feof($fp))   or die(sprintf("XML error: %s at line %d",    xml_error_string(xml_get_error_code($xml_parser)),    xml_get_current_line_number($xml_parser))); fclose($fp); } else { echo '<span class="'. $detail_style .'">Feed is temporarily not available</span>'; } // Free up memory used by the XML parser xml_parser_free($xml_parser); } function startElement($parser, $name, $attrs) { global $insideitem, $tag, $title, $description, $link, $date, $image, $insideimage; if ($insideitem || $insideimage) { $tag = $name; } if ($name == "R" ) { $insideitem = true; } if ($name == "IMAGE") { $insideimage = true; } } function endElement($parser, $name) { global $insideitem, $tag, $title, $description, $link, $image, $date, $insideimage, $show_detail, $headline_style, $detail_style, $count, $max; if ($name == "do not use....") { echo '<img src="'. htmlspecialchars(trim($image)) .'" /><br /><br />'; $insideimage=false; $image=""; } else if ($name == "R") { //&& $count < $max) { //$count++; printf('<a href="%s" class="'. $headline_style .'" target="_blank"><b>%s</b></a><br />',trim($link),trim($title)); if ($show_detail) printf('<span class="'. $detail_style .'">%s</span><br />%s<br />',trim($description), trim($date)); else { echo "<br /><br />"; } $title = ""; $description = ""; $date = ""; $link = ""; $insideitem = false; } else if ($count >= $max) { $title = ""; $description = ""; $link = ""; $insideitem = false; } } function characterData($parser, $data) { global $insideitem, $tag, $title, $description, $link, $date, $image, $insideimage; if ($insideimage) { switch ($tag) { case "U": $image .= $data; break; } } if ($insideitem ) { switch ($tag) { case "T": $title .= $data; break; case "S": $description .= $data; break; case "FS": $date .= $data; break; case "U": if (!is_string($link)) $link=""; $link .= $data; break; } } } ?>[/pre]
  6. Sweet! It works now, thanks. I knew it was going to be an easy fix.
  7. How can I, or is it possible, to 'include' or 'require' a php page and send a query string as well? ex: [code]include $_SERVER['DOCUMENT_ROOT']."/help_page.php?table=gen_help";[/code] thanks!
  8. Thanks Ken! That got me closer to where I wanted to be (printing just the one value) I replaced your print_r statement with the code below, and it prints just the value. Please advise if there is a better or cleaner way to do this. Many thanks again. [code]/* print the result */ foreach ($row as $value){ print_r ($value); }[/code]
  9. Below is my code snippet, I'm sure there is an easy fix but I am stumped. Any help is appreciated :-) -thanks! It returns "Resource id #6" and I've tried tweaking the query many, many times with no luck. [code]     function grabData($column, $table, $index)     {     /* connect to db */     mysql_connect('localhost','DBName,'PW');     $dbcnx=mysql_select_db('TableName');     if (!$dbcnx) {     exit("Unable to connect to the database server at this time.");     }     /* construct and run the query */     $query = "SELECT $column FROM $table WHERE ItemNumber = $index";     $result=mysql_query($query);     echo $result;     return;     } [/code]
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.