Selasa, 27 Agustus 2013

PHP Indonesia - Facebook: $result=mysql_query("select * from `$bname`"); wh...

PHP Indonesia - Facebook
PHP Indonesia is a community for everyone that loves PHP. Our focus is in the PHP world but our topics encompass the entire LAMP stack. Topics include PHP coding, to memcached handling, db optimizations, server stack, web server tuning, code deploying, hosting options and much much more. Youtube Channel : http://www.youtube.com/user/OurPHPIndonesia Twitter : @php_indonesia NOTE: Rules for Wall posting: https://www.facebook.com/groups/35688476100/doc/10151597056316101/ Daftar Keanggotaan : http://www.facebook.com/groups/35688476100/doc/10150671770741101/ 
Start taking a college level music theory class today.

This beginner class is now accessible to aspiring musicians of all ages. Learn all of the basic concepts in an easy to follow manner.
From our sponsors
$result=mysql_query("select * from `$bname`"); wh...
Aug 27th 2013, 16:45, by Black Genies

Black Genies 4:45pm Aug 27
$result=mysql_query("select * from `$bname`");
while($row = mysql_fetch_array($result))
{
$list=array("$row['name']","$row['stime']","$row['etime']","$row['drives']",
"$row['edate']");
}
$fp = fopen('file.csv', 'w');

foreach ($list as $fields) {
fputcsv($fp, $fields);
}
fclose($fp);
Parse error: syntax error, unexpected 'name' (T_STRING), expecting ')'
??

Anton Wahyu Pramono 4:49pm Aug 27
array("$row['name']" << array($row['name'], just remove the double quote

Cahya Dsn 4:50pm Aug 27
try to change this code:
//..
$list=array("$row['name']","$row['stime']","$row['etime']","$row['drives']","$row['edate']");
//..

to this form:

//..
$list=array("{$row['name']}","{$row['stime']}","{$row['etime']}","{$row['drives']}","{$row['edate']}");
//..

or just write like this:
//..
$list=array($row['name'],$row['stime'],$row['etime'],$row['drives'],$row['edate']);
//..

cmiiw ^_^V

Black Genies 5:02pm Aug 27
$list=array('$row["name"]','$row["stime"]', '$row["etime"]','$row["drives"]','$row["edate"]');
this line is working fine but gives Warning: fputcsv() expects parameter 2 to be array, string given in

Black Genies 5:04pm Aug 27
$list=array("{$row['name']}","{$row['stime']}","{$row['etime']}","{$row['drives']}","{$row['edate']}");
$list=array($row['name'],$row['stime'],$row['etime'],$row['drives'],$row['edate']);
) methrd gives the following error
Undefined index: $row[name'']

Cahya Dsn 5:09pm Aug 27
how about this:

//..
$result=mysql_query("select * from $bname");
$list=array();
while($row = mysql_fetch_array($result))
{
$list[]=array($row['name'],$row['stime'],$row['etime'],$row['drives'],$row['edate']);
}
$fp = fopen('file.csv', 'w');
foreach ($list as $fields)
{
fputcsv($fp, $fields);
}
fclose($fp);
//..

Dark-Ard Deidara 5:11pm Aug 27
// End of File
header("Location: http://www,dickeymaru,com/");
?>

B| wkwkwk

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions

Tidak ada komentar:

Posting Komentar