[PHP-DB] query error

2005-04-16 Thread pete M
I've got a database table with a whole list of "windows" file paths. eg Advent Tower PC\C\Program Files\Microsoft Office\Microsoft Binder.lnk Advent Tower PC\C\Program Files\Microsoft Office\Microsoft Excel.lnk Advent Tower PC\C\Program Files\Microsoft Office\Microsoft Office Setup.lnk Advent Tower

[PHP-DB] Re: checkbox into mysql using php

2005-02-16 Thread pete M
foreach($_POST['name'] as $k => $v){ } moses Woldeselassie wrote: hi all I need a simple php script to use for html Select from the list (check all that apply): kind regards meberat -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DB] Re: Form Mail Script/ Class

2005-02-03 Thread pete M
www.hotscripts.com - there's hundreds Malcolm JC Clark wrote: I am looking for a good reliable php script/ class to process enquiries. Maybe there is a de facto php script/ class like Matts perl Script Archive? Kind Rgds Malcolm -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, vis

[PHP-DB] Re: MySQL backup software

2004-10-27 Thread pete M
Matthew Perry wrote: Does anyone know a free MySQL backup program to schedule regular backups? This is the script I use - its wicked cos it can ftp and email backups as well http://worldcommunity.com/opensource/utilities/mysql_backup.html -- PHP Database Mailing List (http://www.php.net/) To uns

[PHP-DB] Re: sending e-mails

2004-10-22 Thread pete M
phpmailer.sourceforge.net Miguel Guirao wrote: Hi!! I have a script in PHP that should send an e-mail from a specific e-mail account, let's say [EMAIL PROTECTED] to a customer's e-mail account, using the smtp_mail.inc class of PHP. But, Do I need to authenticate first

[PHP-DB] Guru Question

2004-10-19 Thread pete M
I have 2 tables, job_stats (the job statuses) and works which are job items I want to count the number of jobs not completed , however I also want all the statuses, ie even a status with a zero value.. select job_stats.job_stat_id, job_stat_color, concat_ws(': ', job_stats.job_stat_code, job_stat

[PHP-DB] Re: Which Database Abstraction Layer ?

2004-09-02 Thread pete M
ADODB Jean-Philippe côté wrote: Hi, I'm trying to choose a database abstraction layer for a project and I'm having difficulty making up my mind. The two I'm currently looking at are: ADOdb and MDB2 (from PEAR). I was recommended to use MDB2 but its still a beta version and the documentation is

[PHP-DB] Re: endless loop / running as a service?

2004-07-13 Thread pete M
If you have shell access then run a cron job every minute or so see crontab http://www.nerc-online.com/support/www/crontab.html H. J. Wils wrote: I'd like to have a serverside script (php) who checks 24 hours a day wether theres a file uploaded to my server. But I don't know if that is possible,

[PHP-DB] Re: $_SERVER['HTTP_REFERRER']

2004-07-12 Thread pete M
I think its either $_SERVER['HTTP_REFERER'] and not $_SERVER['HTTP_REFERRER'] [EMAIL PROTECTED] wrote: For some reason I cannot get this to work. I'm trying to use the referrer to redirect at the end of a form processing script, but it wont recognize the referrer. I read that it just wont work wi

[PHP-DB] Re: Date Select

2004-06-25 Thread pete M
select * from table where week(date_field) = ( week(now()) -1 ) Tom Chubb wrote: How can I query a MySQL table to get the latest results from a date field? Basically, I am inserting several records at a time at the end of each week. I want to have a page that displays the results for the last week

[PHP-DB] Re: Dropdown menus from DB query

2004-06-18 Thread pete M
this is where smarty templating is so cool using PEAR db php code $sql = 'select id, name from names order by name asc'; $smarty->assign('names',$db->getAssoc($sql)); template {html_options options=$names} Cole Ashcraft wrote: How would you create a drop down menu from a database query? I have fi

[PHP-DB] Re: content managment systems

2004-06-16 Thread pete M
I use www.tikiwiki.org love it pete Lisi wrote: I am looking for open source CMSs that: 1) use PHP/Mysql 2) are relatively easy to install, for someone familiar with both PHP and MySQL 3) also easily allow you to change the layout/template from the default For instance, if I want to hire a graphi

[PHP-DB] Re: Sample Code

2004-06-15 Thread pete M
lots of sample code here http://www.zend.com/codex.php Mike Koponick wrote: Hello all, I was wondering if anyone had some sample code that I could use for a small project. What I would like to do is select data in a date field, like: From: 6-1-04 To: 6-15-04 Then output to a text file. I have o

[PHP-DB] Re: automatic call reference creation

2004-06-10 Thread pete M
e. 001 for the first 'call reference code' for the day. when the next call is logged, the next unique available numerical should be assigned and combined with the date to form the call reference number. hope this makes it a bit clearer. "Pete M" <[EMAIL PROTECTED]> wrote in

[PHP-DB] Re: automatic call reference creation

2004-06-10 Thread pete M
not sure what u want here but have you looked at the identiry field ?? its called auto_increment in mysql and this gives it record in a database a unique number eg "Insert into table (date_call)values(now() )" then after the insert do "select last_insert_id()" pedro Gawie Marais wrote: hi all, i

Re: [PHP-DB] strange query

2004-06-01 Thread pete M
doh ! thanks Mikhail U. Petrov wrote: Hi! You should use having c>2 instead of where c>2. Tuesday, June 1, 2004, 7:09:29 PM, pete wrote: pM> I'm running this query agains a mysql database, its a list of statuses pM> with a joined table that shows the number of job in that status with pM> more

[PHP-DB] strange query

2004-06-01 Thread pete M
I'm running this query agains a mysql database, its a list of statuses with a joined table that shows the number of job in that status with more than 2. However I get the error Unknown column 'c' in 'where clause' select job_stats.job_stat_id, job_stat, job_stat_code, count(works.job_stat_id) a

Re: [PHP-DB] Pear - autoExecute()

2004-04-29 Thread pete M
SOC); I'm using the getAll(), query(), getOne(), etc ok - it just doesnt see autoExecute() ?? Or I'm missing the obvious ! pete ;-) Uzi Klein wrote: Did you use $db = new DB; ? -----Original Message- From: pete M [mailto:[EMAIL PROTECTED] Sent: Thursday, April 29, 2004 14:31 To: [E

Re: [PHP-DB] Pear - autoExecute()

2004-04-29 Thread pete M
That's where I copied the code below that does not work ;-( Uzi Klein wrote: http://pear.php.net/manual/en/package.database.php -Original Message- From: pete M [mailto:[EMAIL PROTECTED] Sent: Thursday, April 29, 2004 14:03 To: [EMAIL PROTECTED] Subject: [PHP-DB] Pear - autoEx

[PHP-DB] Pear - autoExecute()

2004-04-29 Thread pete M
Am trying the following bit of code usind the PEAR DB.php class $table = 'reports'; $fields = array('report_name' => $_POST['report_name'], 'report_desc' => $_POST['report_desc'] ); $res = $db->autoExecute($table,$fields,DB_AUTOQUERY_INSERT); if (DB::isError($res)) { die($res->

[PHP-DB] Re: passing var array

2004-04-26 Thread pete M
http://localhost/index.php?val_one=one&val2=2 on index.php print_r($_GET) will show the array echo "val l=".$_GET['val_one']; echo "val 2=".$_GET['val2']; its CAse senSitivE you can also do a foreach($_GET as $k => $v) { echo $k."=".$v; } Sukanto Kho wrote: Hi, How to pass var array to

[PHP-DB] Re: Selecting Null columns

2004-04-22 Thread pete M
SELECT * FROM questions WHERE answer IS NULL SELECT * FROM questions WHERE answer IS NOT NULL Pambos Nicolaou wrote: Hi everyone I am a new user of this mail list and I hope that it will be helpful. I am trying to show the content of a MySQL table(raw) where the content of a column is NOT NUL

[PHP-DB] Re: finding data

2004-04-15 Thread pete M
the way I would do this is with count() $row = mysql_fetch_assoc("SELECT count(*) as c FROM bivalues WHERE myvalue = '$zchar'") if ($row['c'] > 0) { echo 'result 2 - found it' }else{ echo 'NOT found' } hope it helps Pete Douglas D Hull wrote: I am trying to find data, or if not

[PHP-DB] Re: headers already sent

2004-04-14 Thread pete M
make susre that the pete Matthew Perry wrote: When I insert the following header: header ("Content-type: application/vnd.ms-excel"); header ("Content-Disposition: attachment" ); I get the messages: *Warning*: Cannot modify header information - headers already sent by (output starte

[PHP-DB] Re: help desk software

2004-04-08 Thread pete M
http://freshmeat.net/search/?q=helpdesk§ion=projects&Go.x=0&Go.y=0 I use oneorzero available at www.sf.net http://helpdesk.oneorzero.com/ Redhat wrote: Anybody out there familiar with some helpdesk software? I found some called "teacup" that runs as a cgi and used Postgres but I wanted to see if

[PHP-DB] Re: Interbase: How to get table structure via SQL ?

2004-02-18 Thread pete M
Us use the PEAR db abstraction layer which has a function to do this pete Dizem Pgc wrote: Hi, does anyone know how to get the Structure of a table using SQL. (ex.: SELECT ?RELATION_SOURCE?, RDB$RELATION_NAME FROM RDB$RELATIONS) Isn't there any table containing the CREATE STATEMENT for a table? M

[PHP-DB] Re: Update Statement

2004-02-18 Thread pete M
This one cooked me 2 when I realised my online by was 3x and local was 4x only 4+ supports a join on an update statement from the manual Starting with MySQL Version 4.0.4, you can also perform UPDATE operations that cover multiple tables: UPDATE items,month SET items.price=month.price WHERE it

[PHP-DB] Re: editing, deleting records

2004-01-22 Thread pete M
Kirk Babb wrote: Here's a part of my code, which is retrieving player records from mysql and displaying them in a table: - if($queryChk3 !== 0){ print(" Player Roster for $teamName Last NameFirs

[PHP-DB] Re: Quick Question: Line Breaks

2004-01-09 Thread pete M
see 2 comments below Jacob Hackamack wrote: Hello, I have a couple of quick questions. When I execute this code on my php page (I know that the .PSD image isn¹t web ready, but Safari does what I need it to do :) ) it displays the entire source as one line. Is there anyway to have it be broken.

[PHP-DB] Re: array

2003-12-11 Thread pete M
if($access ==2) { echo "do something"; } Peppe wrote: Hi I have a variable cold $access and there are values 1,2,3,4,5 How can I check for example If ($access =='2'){ echo "go further"; } How can I make this work Thanx in advance -- PHP Database Mailing List (http://www.php.net/) To unsubsc

[PHP-DB] Re: SQL question

2003-12-11 Thread pete M
$query = "SELECT * FROM x_table WHERE name like '%part_of_name%' "; Constantin Brinzoi wrote: I know it is possible to search a database like this: SELECT * FROM x_table WHERE name="%part_of_name%" but I don't know for sure the correct command. Could you tell me the right syntax? TIA Aurel.

[PHP-DB] Re: database sends unclear messages

2003-12-10 Thread pete M
Looks like there a crawler/search emgine indexing your site .. pete Merlin wrote: Hi there, I have a LAMP appplication which sends a report via email if a database error occures. This workes pretty fine. The message contains sql statement and error message from the db server. Lately there are

[PHP-DB] Re: sql query

2003-11-25 Thread pete M
got round the problem like this select distinct(to_days(date_file_created)), date_file_created from files Pete M wrote: why does this select date(date_file_created) from files create the error error near near '(date_file_created) from files' at line 1 trying to extract the date p

[PHP-DB] sql query

2003-11-25 Thread pete M
why does this select date(date_file_created) from files create the error error near near '(date_file_created) from files' at line 1 trying to extract the date part of the date_tile filed tia pete -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.

Re: [PHP-DB] how obtain last id past insert?

2003-11-20 Thread pete M
depends which DB your using in mysql its "select last_insert_id()" and in mssql for example its "select @identity" have fun Pete Webmaster D.G.R.E.R. wrote: Hi: How i obtain inmediatly the id of last insert ? For example i have a forum, when the user post a question, i send a mail to adm

[PHP-DB] Re: Linux/PHP with M$/SQL Server

2003-11-20 Thread pete M
I use PEAR db which is included wit the php distribution http://pear.php.net/manual/en/package.database.php http://vulcanonet.com/soft/?pack=pear_tut pete Matt Giddings wrote: Has anybody been able to bridge a Linux/php setup to a M$/SQL Server database? Is this possible using JDBC or a Unix O

[PHP-DB] Re: about some MySQL basics

2003-11-12 Thread pete M
I use phpmyadmin http://www.phpmyadmin.net/home_page/ ;-) pete Koala Yeung wrote: > Maybe tis a little bit out of topic... > > I want to learn using PHP with MySQL. > After long time reading, I still have no idea how to build a database on a > remote computer > How to create a MySQL database on

Re: [PHP-DB] Select Value with 's

2003-11-06 Thread pete M
why the backticks and not quotes ? pete Ma wrote: hi! do not quite understand your problem.. pls post some code? heres a small snippet that should work well... $qry = 'SELECT `customer` FROM `customerList` ORDER BY `customer`'; $res = mysql_query($qry); while($customer = mysql_fetch_object($r

[PHP-DB] Re: Page counter from a query ?

2003-11-04 Thread pete M
and here's a tutorial http://www.phpnoise.com/tutorials/9/1 ;-) Larry Sandwick wrote: Is there a way to limit the number of pictures being display from a query? Example. Let say I have 100 pictures and I would like to display only 20. How would I put the numbers at the bottom of the page?

[PHP-DB] Re: Page counter from a query ?

2003-11-04 Thread pete M
I use PEAR db to make my life easy.. here's their pager class http://vulcanonet.com/soft/index.php?pack=pager pete Larry Sandwick wrote: Is there a way to limit the number of pictures being display from a query? Example. Let say I have 100 pictures and I would like to display only 20. How w

[PHP-DB] Re: HTML mail

2003-11-03 Thread pete M
I use the class object http://phpmailer.sourceforge.net/ makes life a doddle pete Ronald Wiplinger wrote: I got an interesting program to do: For an MLM company I should make the news letter from the upline to the direct downline (A sends emails to his NEXT DIRECT downline B1~ B12 emails) To use

[PHP-DB] Re: using

2003-10-21 Thread pete M
pete MüCella Erdem Efe wrote: Hi; I need to usestatement in a xxx.php file. I have to use a php variable on the right of the day variable like > . When i get this variable in abc.php file if (phpversion() <= "4.1.0") { $vars = array_merge($HTTP_GET_VARS, $HTTP_POST_VARS); } else { $vars

[PHP-DB] Re: How can I tell if Recordset is empty using MSSQL and ODBC?

2003-10-20 Thread pete M
if(count($data) > 0) { //out rows } pete Karen Resplendo wrote: In VBscript an empty recordset returns the "End of File" marker: If rs.EOF Then do nothing How can I do this in PHP using MS SQL Server and ODBC drivers? Here is a peace of my code: $data= odbc_do($connectionSDWIS,"SEL

[PHP-DB] Re: Sessions and MySQL?

2003-10-16 Thread pete M
might seem a bit long winded but this is how I would code it $sql = "INSERT INTO $table ( salutation, name, city} VALUES {" $sql .= "'".$_SESSION{'salutation']."', " $sql .= "'".$_SESSION{'name']."', " $sql .= "'".$_SESSION{'city']."' ) " mysql_query($sql); regards pete mysql_query("INSERT

[PHP-DB] Re: Variables not working within Functions

2003-10-16 Thread pete M
> == > function LoginSystem() > { global $username; > echo ""; > if ( !isset( $_SESSION['login'] ) ) { Adam Symonds wrote: Hi, I am starting to us functions with my work but I am having troubles With the variables in the functions.. If I have the followi

[PHP-DB] Re: [PEAR Newbie] PEAR problems

2003-10-10 Thread pete M
Not user but I think the DB oject is not referenced because of function try the following to see if it works (not tested just a hunch) > require_once("DB.php"); > $dbname="c:\www\support\database\support.gdb"; > $dbuser="SYSDBA"; > $dbpass="masterkey"; > $dbhost="localhost"; >

Re: [PHP-DB] mysql_error() (was Re: Getting last insert id?)

2003-10-09 Thread pete M
http://www.php.net/manual/en/function.mysql-error.php Ben Edwards wrote: On Thu, 2003-10-09 at 16:33, pete M wrote: $new_id = mysql_query('select last_insert_id()'); your can also user it within a query - eg $sql = ' insert into related table parent_id, data , data2) values

[PHP-DB] Re: Getting last insert id?

2003-10-09 Thread pete M
$new_id = mysql_query('select last_insert_id()'); your can also user it within a query - eg $sql = ' insert into related table parent_id, data , data2) values (last_insert_id(), 23, 45); pete hris Payne wrote: Hi there everyone, I use the below to insert some data into my database: mysql_qu

Re: [PHP-DB] HELP With UPDATE Query in mySQL

2003-10-06 Thread pete M
and put it inside a transaction cos in case something goes wrong part of the way through pete Jeff Shapiro wrote: This should do it: UPDATE Bookings SET Booking_Start_Date = CONCAT(DATE_FORMAT(Booking_Start_Date, '%Y-%m-%d'), '09:00:00'), Booking_End_Date = CONCAT(DATE_FORMAT(Booking_End_Date

[PHP-DB] Re: large csv text file import into postgresql via PHP

2003-09-26 Thread pete M
oops forgot to mention reson for cron... Timeouts processing 143mb can take a long time. also you need to use fgets to read the file one line at a time.. pete Dave wrote: we have a number of csv dumps that occasionally have to be used to update tables in a postgres database... normally thi

[PHP-DB] Re: large csv text file import into postgresql via PHP

2003-09-26 Thread pete M
I've written and automated system that does the following:: similar problem ** every evening a cron job executes on LAN linux and spools of prices into a csv text file ** The file is ftp/uploaded to remote server on web and a database entry created to show file ** cron job on remote server check

[PHP-DB] Re: ADO Connection Problems

2003-09-17 Thread pete M
Why are you using COM - haveyou looked at PEAR DB - this is class that makes conencting ot various DB's easy in php http://pear.php.net/manual/en/package.database.php Joe Mack wrote: I am having problems making things happen in a Microsoft Access Database that I am connecting to through an ADO C

[PHP-DB] Re: Why varying functionality across php db apis for db metadata?

2003-09-17 Thread pete M
Mike Klein wrote: For example, php mysql library supports list_dbs and list_tables commands as well as getting table metadata. MySQL sql also 'natively' supports these commands (show databases, show tables, describe ). Why not similar commands for Oracle, SQLServer, etc.? These are simply selects a

[PHP-DB] Re: mount command with php in through the web

2003-08-15 Thread pete M
check out webmin http://www.webmin.com this allows you to administer thewhole server over the web ;-) Suman Aluru wrote: Hi All, is there any way i can run mount command with php script in the web , bcz. mount command run only for super user as apache user is there any way to run. plz. help me

[PHP-DB] Re: adding integer to field in query

2003-08-15 Thread pete M
is the field null ??? - make sure it has zero as a default value John Dillon wrote: How do you add a number to a field within the query, ie without having to extract? Eg $query="UPDATE Choice SET visits=(visits+1) WHERE ID='$thisID'"; is the above "visits=(visits+1)" legal, cos it doesn't work a