Jump to content

kpasiva

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

About kpasiva

  • Birthday 09/05/1983

Contact Methods

  • MSN
    kpa.siva@hotmail.com

Profile Information

  • Gender
    Male
  • Location
    Chennai, India.

kpasiva's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi, You have to use string handling functions to achieve this, <?php if (strpos($the_product_info['products_model'],'g') !== false) { echo 'It works!!!'; } ?>
  2. Hi, There is no error in the given script, since i have executed the script locally with test table. You might made some error while integrating with your original file. Please check you might for got to remove unwanted curly braces ({) -Siva
  3. Alright, Here is the script for you <?php $host = 'localhost'; $user = 'username'; $pass = 'password'; $db = 'database_name'; $table = 'zen_address_book'; $file = 'export'; $link = mysql_connect($host, $user, $pass) or die("Can not connect." . mysql_error()); mysql_select_db($db) or die("Can not connect."); $replace = array( 'entry_firstname' => 'First Name', 'entry_lastname' => 'Last Name', 'entry_street_address' => 'Address', 'entry_suburb' => 'City', 'entry_state' => 'County', 'entry_postcode' => 'Post Code' ); $values = mysql_query("SELECT entry_firstname, entry_lastname, entry_street_address FROM ".$table.""); $i=0; while ($rowr = mysql_fetch_assoc($values)) { if($i==0) { foreach(array_keys($rowr) as $title) $csv_output .= '"'.str_replace(array_keys($replace), $replace, $title).'",'; $csv_output .= "\n"; } foreach ($rowr as $key => $value) { $csv_output .= '"'.$value.'",'; } $csv_output .= "\n"; $i++; } $filename = $file."_".date("Y-m-d_H-i",time()); header("Content-type: application/vnd.ms-excel"); header("Content-disposition: csv" . date("Y-m-d") . ".csv"); header( "Content-disposition: filename=".$filename.".csv"); print $csv_output; exit; ?>
  4. Oh.. Got it but any way you have to use separator to place the title in a separate columns. Instead of using SHOW COLUMNS to get column title, Use array_keys from the result row $title_array = array_keys($row); then it will return only the selected column titles from the select row. But you have to use mysql_fetch_assoc instead of mysql_fetch_row
  5. Hi, You forgot to add column separator (,) while inserting column titles, replace the line <?php $csv_output .= str_replace(array_keys($replace), $replace, $row['Field'])." "; ?> to <?php $csv_output .= '"'.str_replace(array_keys($replace), $replace, $row['Field']).'",'; ?>
  6. The script used to set header and display image content, <?php //setting the header information to display the image header('Content-type: $ftype'); echo $fdata; ?> has to be moved to the else part because the error msg ("No image available") can't be displayed if session doesn't exist. Check the script by moving the above script to the else part whether it shows the error - "No image available".
  7. Hi, Need to add script to check user selections and the query has to be formed as, <?php $query = "SELECT book_id, book_title,author,keyword FROM book"; if($_POST['field']=='aname') $query .= " WHERE author LIKE '%$search%'"; elseif($_POST['field']=='title') $query .= " WHERE book_title LIKE '%$search%'" elseif($_POST['field']=='keyword') $query .= " WHERE keyword LIKE '%$search%'" ?>
  8. Hi, Set your domain name in the place of yourdomain.com setcookie("auth", "1", 0, "/", "yourdomain.com", 0);
  9. kpasiva

    Zen Cart

    Hello, The email content is sending in Text format instead of HTML. You can use, <a href="http://www.example.com/index.php?main_page=terms">Click here</a> In Text format. Put the full url without anchor tag, Click here http://www.example.com/index.php?main_page=terms Otherwise change your email format to HTML.
  10. Use, $message = file_get_contents('reg_confirm.tpl');
  11. Hi, Use, iif(in_array($mod_array[0],(array)$items). The warning will come if the second argument is not an array. So put (array) in front of the array variable ($items). The same should be added for all array functions otherwise it will show up warning if the argument is not an array.
×
×
  • 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.