Jump to content

pozer69

New Members
  • Posts

    7
  • Joined

Profile Information

  • Gender
    Not Telling

pozer69's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. right now i have the following code entered and it works...is there any other way or should i just let it be? global $select, $export;
  2. thank you for your replies...however i am still receiving an undefined variable export...how do i return/pass the export and select statements from the function? i dont know if i am saying it right but in c/c++ at the end of the function i could throw in a return ($export);
  3. My code doesnt seem to be executing correctly. as i submit on a form the two variables, user and country, are then used to select from the database one of 6 options, all users and all countries, all users and us only, all users and foreign countries, indiv users and all countries, indiv users and us, and indiv users and foreign coutries. It might be a passing variable error, im not sure. I usually code in c++ so my coding may be off. Here is the area that is troubling me: $user=$_POST['user']; $country=$_POST['country']; function indiv_user() { if($country == "us") { $select = "SELECT * FROM companies WHERE user_assigned='$user' AND co_country = 'US'"; $export = mysql_query ( $select ) or die ( "" ); } elseif($country == "foreign") { $select = "SELECT * FROM companies WHERE user_assigned='$user' AND co_country != 'US'"; $export = mysql_query ( $select ) or die ( "" ); } else { $select = "SELECT * FROM companies WHERE user_assigned='$user'"; $export = mysql_query ( $select ) or die ( "" ); } } function all_user() { if($_POST['country']== 'us') { $select = "SELECT * FROM companies WHERE co_country = 'US'"; $export = mysql_query ( $select ) or die ( "" ); } elseif($_POST['country']== 'foreign') { $select = "SELECT * FROM companies WHERE co_country != 'US'"; $export = mysql_query ( $select ) or die ( "" ); } else { $select = "SELECT * FROM companies"; $export = mysql_query ( $select ) or die ( "" ); } } if($user == "all") { all_user(); } else { indiv_user(); } The code below this calls on the export statement but i am receiving an undefined variable export. Everything else on the page works bc if i get rid of the functs and if statements and just have one select and export statement everything works perfectly.
  4. <?php $host = 'localhost'; $user = 'gotbizbr_researc'; $pass = '******'; $db = 'gotbizbr_research'; $table = 'companies'; $file = 'companies'; $link = mysql_connect($host, $user, $pass) or die("Can not connect." . mysql_error()); mysql_select_db($db) or die("Can not connect."); $result = mysql_query("SHOW COLUMNS FROM " . $table . ""); $i = 0; if(mysql_num_rows($result)>0) { while ($row = mysql_fetch_assoc($result)) { $csv_output .= $row['Field']."; "; $i++; } } $csv_output .= "\n"; $values = mysql_query("SELECT * FROM ".$table.""); while ($rowr = mysql_fetch_row($values)) { for ($j=0;$j<$i;$j++) { $csv_output .= $rowr[$j]."; "; } $csv_output .= "\n"; } $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; ?>
  5. SOLVED: # Install build tools, debian helpers and fakeroot apt-get install build-essential debhelper fakeroot # source code should reside in /usr/src cd /usr/src # Download PHP source apt-get source php5 # Install all packages required to build PHP5 apt-get build-dep php5 cd php5-5.2.3 How a package is compiled is set within the files contained in the debian directory of a package. Rules for configuring the compile process can be found in debian/rules. In this file there is a line that reads --with-gd=shared,/usr --enable-gd-native-ttf \. This links to the Ubuntu distributed version of LibGD as a shared library. It is part of the autoconf script that customises the compilation of PHP. I replaced this line with --with-gd=shared --enable-gd-native-ttf \. This causes the compilation process to use the bundled version of GD and make a shared library. Once the package has been reconfigured it can be compiled and installed by: # build the php5-* packages dpkg-buildpackage -rfakeroot cd .. # Install the new php5-gd package dpkg -i php5-gd_5.2.3-1ubuntu6.3_i386.deb /etc/init.d/apache2 restart http://cumu.li/2008/5/13/recompiling-php5-with-bundled-support-for-gd-on-ubuntu
  6. I am not sure how to do what you said but I searched and found this but it still didnt work: apt-get install build-essential debhelper fakeroot cd /usr/src apt-get source php5 apt-get build-dep php5 cd php5-5.2.3 dpkg-buildpackage -rfakeroot cd .. dpkg -i php5-gd_5.2.3-1ubuntu6.3_i386.deb /etc/init.d/apache2 restart What do you think?
  7. need help configuring/advice with php_gd. Please be mindful im a linux noobie. I received the following error: undefined function imageantialias() here is my php output:
×
×
  • 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.