Re: [PHP-DB] retrieved data from mysql to be shown in spreadsheet

2004-08-23 Thread Lester Caine
Balwantsingh wrote: I am developing a page using PHP for entering the data into tables made in mysql. I want that when user click on Reports button the data (which will retrieve from mysql) should be shown in Spreadsheet (Calc) of Open Office. Pls. tell how it can be done. Does MySQL have a JDBC

[PHP-DB] Re: I have a CR-LF problem when pulling stuff out of my DB

2004-08-23 Thread Nadim Attari
function RemoveWhiteSpaces($str = '') { $search = array ('([\r\n])'); $replace = array (\n); $str = preg_replace ($search, $replace, $str); return $str; } Just a thought: 1. Read contents of the file (file() and implode() in php) so that the contents are contained in an array 2.

Re: [PHP-DB] Inserting a ' into mySQL

2004-08-23 Thread Jonathan Haddad
use mysql_escape_string. http://us3.php.net/manual/en/function.mysql-escape-string.php Jon Ron Piggott wrote: I have begun to create a Christian Ministry Directory. It is on the ministry web site I am building at http://www.actsministries.org/ministrydirectory/ . One of the problems I am now

[PHP-DB] IP-Banning

2004-08-23 Thread Daniel Schierbeck
Hi there, I'm writing a script that'll enable me to ban certain IP-addresses from a site, and i have a qouple of questions: 1. When inserting the IP into the database (probably MySQL), should i use the dotted- or the long-type? 2. What is the best way to ban IP ranges? --

Re: [PHP-DB] IP-Banning

2004-08-23 Thread Greg Donald
On Mon, 2004-08-23 at 11:24, Daniel Schierbeck wrote: Hi there, I'm writing a script that'll enable me to ban certain IP-addresses from a site, and i have a qouple of questions: 1.When inserting the IP into the database (probably MySQL), should i use the dotted- or the

[PHP-DB] letting a table name be a constant

2004-08-23 Thread Ben Galin
Hello, Regarding this code: [PHP code] // This works $name=name; $table=mytable; $mysql_connect(localhost,,) or die(Error: .mysql_error()); $mysql_select_db(mydb) or die(Error: .mysql_error()); $mysql_query(INSERT INTO $table (`id`,`name`) VALUES ('','$name')); [/PHP code] I want to

Re: [PHP-DB] letting a table name be a constant

2004-08-23 Thread Justin Patrin
On Mon, 23 Aug 2004 17:06:40 -0700, Ben Galin [EMAIL PROTECTED] wrote: Hello, Regarding this code: [PHP code] // This works $name=name; $table=mytable; $mysql_connect(localhost,,) or die(Error: .mysql_error()); $mysql_select_db(mydb) or die(Error: .mysql_error());

Re: [PHP-DB] letting a table name be a constant

2004-08-23 Thread John Holmes
Ben Galin wrote: I want to define() TABLE as a constant instead of using the variable $table [PHP code] // This runs without an error but does *not* insert a new row $name=name; define(TABLE, mytable); $mysql_connect(localhost,,) or die(Error: .mysql_error()); $mysql_select_db(mydb) or

Re: [PHP-DB] letting a table name be a constant

2004-08-23 Thread Ben Galin
On Aug 23, 2004, at 8:12 PM, John Holmes wrote: You can't have a constant in a string. You'd do it like this: mysql_query(INSERT INTO . TABLE . (`id`,`name`) VALUES ('','$name')); Thanks, John and Justin. Wasn't thinking about that. The other error you have, and I don't know how you think this

[PHP-DB] Tables

2004-08-23 Thread Hafidz Abdullah
Hi everyone. I'm new to PHP. And so I'm so keen on finding people who are willing to share their knowledge with me. I've generated forms containing text boxes, check boxes, text areas, drop boxes, radio buttons hidden fields as an HTML table with two columns, the first for the desciption,

Re: [PHP-DB] letting a table name be a constant

2004-08-23 Thread Jason Wong
On Tuesday 24 August 2004 08:18, Ben Galin wrote: You're right. It doesn't run. I retyped instead of copy-and-paste'd; that's a typo. Please, when you post code make sure they're verbatim by using copy paste. That way people can focus on your actual problem rather than on your typos. --