Re: [PHP-DB] Efficien search queries
hi do you use "OR" and "AND" ? select * from table where pasta like "%spagetti%" or pasta like "%macaroni%" ? eat pasta type fasta a écrit : > I have simple db wik names, links and short (less then 1000 chars) > descriptions. I do offer a search (with the select like %variable% > method) but it seems to be very dumb, on single phrases it goes fine on > combined it it very bad. > Is there a way (link, advice) to spicy it up a bit so the user can get > more out of it each time. > > Thanks in advance. > > R> > > --__-__-__ > eat pasta > type fasta > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- Marius Ursache (3563 || 3494) \|/ \|/ "@'/ ,. \`@" /_| \__/ |_\ \__U_/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Efficien search queries
I have simple db wik names, links and short (less then 1000 chars) descriptions. I do offer a search (with the select like %variable% method) but it seems to be very dumb, on single phrases it goes fine on combined it it very bad. Is there a way (link, advice) to spicy it up a bit so the user can get more out of it each time. Thanks in advance. R> --__-__-__ eat pasta type fasta -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Import/Export data
mysql - Excel what I do very often an what really works great is (escpecially when customers need some download feature for db data for word/mail/excel processing and have no sql/phpMyAdmin knowledge) build a html data table using php: // file download_table.php value1value2 but instead of sending it to the browser as html file, send some "special" headers at the beginning of your script: Header("Content-Type: application/vnd.ms-excel"); Header("Content-Disposition: attachment; filename=\"$filename\""); now your browser "recognizes" the arising download of an excel file and asks you whether to downloading to disk or to open using excel :-) as excel is great in html :-P , it activates its html import filter and that's it! this method is very useful - with complex queries - as a download feature for "dumb users" mysql - Access Access is able to "get external data" out of an excel table... if you know more about the other way (excel/access -> mysql). what if you tried to access your mysql db from excel/access via the myODBC driver ? HTH steff Rosen Marinov wrote: > Hi, > How can I import/Export data to MySQL database using PHP following formats: > EDI, Access, Excel ? > > Where can I find information about this ? > > Thanks, > Rosen Marinov > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] appending new entry to old entries
there might even be some cool SQL you can use tho, which would avoid having to get the data out and then put it back in again. I *think* (don't quote me on this) I remeber seeing something like UPDATE myTable SET myField = CONCAT(myField + 'new string of stuff here') WHERE myID='1' HTH beau // -Original Message- // From: Ron Allen [mailto:[EMAIL PROTECTED]] // Sent: Thursday, 18 April 2002 7:34 PM // To: [EMAIL PROTECTED] // Subject: Re: [PHP-DB] appending new entry to old entries // // // Thanks // // "Jason Wong" <[EMAIL PROTECTED]> wrote in message // news:[EMAIL PROTECTED]... // > On Thursday 18 April 2002 16:51, Ron Allen wrote: // > > I would like to make it so that my helpdesk section can // append entries // in // > > their Master Station Log. Update replaces the // entryany clues?? // > // > You would have to get the original value, append the new // stuff then do // UPDATE. // > // > -- // > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk // > Open Source Software Systems Integrators // > * Web Design & Hosting * Internet & Intranet Applications // Development * // > // > // > /* // > There is very little future in being right when your boss is wrong. // > */ // // // // -- // PHP Database Mailing List (http://www.php.net/) // To unsubscribe, visit: http://www.php.net/unsub.php // -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Updating Many Records oops
Dont think it made sense last time (too little coffee, too much work!) try again IF there is a formula for the value of quantity eg Quantity = Quantity -1 (UPDATE table SET Quantity = Quantity-1 ) IF there is no formual you need to do an update statement for each row EG UPDATE table SET Quantity = "2" WHERE Field = Book1 UPDATE table SET Quantity = "4" WHERE Field = Book2 UPDATE table SET Quantity = "9" WHERE Field = Book3 HTH Peter --- Excellence in internet and open source software --- Sunmaia www.sunmaia.net [EMAIL PROTECTED] tel. 0121-242-1473 --- > -Original Message- > From: Peter Lovatt [mailto:[EMAIL PROTECTED]] > Sent: 18 April 2002 23:30 > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: RE: [PHP-DB] Updating Many Records > > > IF there is a formula for the value of quantity eg Quantity = Quantity -1 > (UPDATE table SET Quantity = Quantity-1 ) you need to do an > update statement > for each row > > EG UPDATE table SET Quantity = "9" WHERE Field = Book3 > > HTH > > Peter > > --- > Excellence in internet and open source software > --- > Sunmaia > www.sunmaia.net > [EMAIL PROTECTED] > tel. 0121-242-1473 > --- > > > -Original Message- > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > > Sent: 18 April 2002 14:21 > > To: [EMAIL PROTECTED] > > Subject: [PHP-DB] Updating Many Records > > > > > > I am not sure if this is possible. > > > > I have a database, and we fetch all the records and then list them. > > > > What we need is the one field in the database to be able to be updated. > > > > Now the field will have different values for each record. Is it > > possible to update the table with lots of different values? > > > > So for example we have: > > > > Field Qantity > > Book 1 5 > > Book2 6 > > Book3 9 > > > > Now when we are shown all these records the quantity is a form > > field and we want to change this but for each record? > > > > Hope the above is enough to go on. > > > > Barry > > > > -- > > PHP Database Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Updating Many Records
IF there is a formula for the value of quantity eg Quantity = Quantity -1 (UPDATE table SET Quantity = Quantity-1 ) you need to do an update statement for each row EG UPDATE table SET Quantity = "9" WHERE Field = Book3 HTH Peter --- Excellence in internet and open source software --- Sunmaia www.sunmaia.net [EMAIL PROTECTED] tel. 0121-242-1473 --- > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: 18 April 2002 14:21 > To: [EMAIL PROTECTED] > Subject: [PHP-DB] Updating Many Records > > > I am not sure if this is possible. > > I have a database, and we fetch all the records and then list them. > > What we need is the one field in the database to be able to be updated. > > Now the field will have different values for each record. Is it > possible to update the table with lots of different values? > > So for example we have: > > Field Qantity > Book 1 5 > Book2 6 > Book3 9 > > Now when we are shown all these records the quantity is a form > field and we want to change this but for each record? > > Hope the above is enough to go on. > > Barry > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] page expires
Add to your header, which will tell the browser not to cache the page, and use the POST method HTH Peter --- Excellence in internet and open source software --- Sunmaia www.sunmaia.net [EMAIL PROTECTED] tel. 0121-242-1473 --- > -Original Message- > From: Natividad Castro [mailto:[EMAIL PROTECTED]] > Sent: 18 April 2002 12:56 > To: [EMAIL PROTECTED] > Subject: [PHP-DB] page expires > > > Hi to all, > > I have form that users fill out and submit. What I'm trying to do > is not to > let users to go back to the form after they have submmited, or if they go > bak, make the page expires. > Can someone please tell me or give an idea on how to do it? > > Thanks in advanced > Nato > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Import/Export data
Hi The most universal way would be to export the table to CSV format. You can then use LOAD DATA INFILE phpMyAdmin to load it into the database. http://www.mysql.com/doc/L/O/LOAD_DATA.html HTH Peter --- Excellence in internet and open source software --- Sunmaia www.sunmaia.net [EMAIL PROTECTED] tel. 0121-242-1473 --- > -Original Message- > From: Rosen Marinov [mailto:[EMAIL PROTECTED]] > Sent: 18 April 2002 17:28 > To: [EMAIL PROTECTED] > Subject: [PHP-DB] Import/Export data > > > Hi, > How can I import/Export data to MySQL database using PHP > following formats: > EDI, Access, Excel ? > > Where can I find information about this ? > > Thanks, > Rosen Marinov > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] drop list inserts
Yes I see what I have done wrong. I named it music_artist instead of nameing it music_artist.id Sorry about that but thanks for the help. I think I'll need more help as I'm still learning. -Original Message- From: Christian Schneider <[EMAIL PROTECTED]> To: Barry Rumsey <[EMAIL PROTECTED]> Date: Thu, 18 Apr 2002 12:17:34 +0200 Subject: Re: [PHP-DB] drop list inserts > Hi Barry, > > Barry Rumsey wrote: > > $query_id = mysql_query("INSERT INTO music_album VALUES > > (NULL, '$music_artist.id' ,'$album' ,NULL ,NULL)"); > > echo " $artist_name and $album has been added to the > > > > Could someone please point out what I'm doing wrong? > > > > is the value of $music_artist.id correct? Also, your has the > name of "music_artist" and the value of the respective id, isn't that > what you want? > > > Regards, > > Christian > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: complicated transtable problem
"Andy" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi there, > > I am still struggling with following problem: > > There are two tables in mysql > 1. city fields: ID, countryid, provinceid, city > containing 2.5 million entries. > 2. province fields: ID, countryid, provinceid, provincename (scratching head) Now, surely that's not normalized... shouldn't it be table Country : id, name table Province : id, country_id, name table City : id, province_id, name > Now there are some cities without a > valid province id in the other table. ... meaning that they link to a non-existent entry? Or to an incorrect entry? Or what? Where did the data come from? Would it be possible to get cleaner data to work with? > I would like to: > 1. delete those province rows (all belonging to > this country) in the province table Not sure I follow here... could you give some sample data? Are you wanting to delete all provinces of a given country which contain no cities? > 2. set the province_id to "" in the city table. This would be simple with a database which supported multi-level SELECTs. However, we will work with what we have. SELECT city.ID FROM city LEFT JOIN province ON city.province_id = province.id WHERE province.provincename IS NULL ... and use the results to build the query... UPDATE city SET province_id=NULL WHERE id IN [your comma-delimited list here] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] page expires
Hi to all, I have form that users fill out and submit. What I'm trying to do is not to let users to go back to the form after they have submmited, or if they go bak, make the page expires. Can someone please tell me or give an idea on how to do it? Thanks in advanced Nato -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] page expires
Hi to all, I have form that users fill out and submit. What I'm trying to do is not to let users to go back to the form after they have submmited, or if they go bak, make the page expires. Can someone please tell me or give an idea on how to do it? Thanks in advanced Nato -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] page expires
http://php.sitecreative.com/faq.php -Original Message- From: Natividad Castro [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 17, 2002 6:12 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] page expires Hi to all, I have form that users fill out and submit. What I'm trying to do is not to let users to go back to the form after they have submmited, or if they go bak, make the page expires. Can someone please tell me or give an idea on how to do it? Thanks in advanced Nato -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] page expires
Hi to all, I have form that users fill out and submit. What I'm trying to do is not to let users to go back to the form after they have submmited, or if they go bak, make the page expires. Can someone please tell me or give an idea on how to do it? Thanks in advanced Nato -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Any idea what's wrog with this query?
It worked, thanks alot! on 4/18/02 1:43 PM, Paul Edmondson at [EMAIL PROTECTED] wrote: see http://www.mysql.com/doc/R/e/Reserved_words.html Your column called 'when' is a reserved word. Thats my first guess at your problem. I've come across this before with MySQL accepting column names that are reserved words. Try changing the column name to something else and try again. On Thu, 2002-04-18 at 18:34, Leif K-Brooks wrote: > I have a field in one of my tables called when, which is type timestamp. > I'm trying to use some of the date functions to get data from it, but it's > not working. The return from mysql_error() is not helpful. Any ideas? > Here's my query: > $query = mysql_query("select month(when) as month,year(when) as > year,dayofmonth(when) as day,hour(when) as hour,minute(when) as > minute,second(when) as second from table") or print "Error: ".mysql_error(); > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Any idea what's wrog with this query?
see http://www.mysql.com/doc/R/e/Reserved_words.html Your column called 'when' is a reserved word. Thats my first guess at your problem. I've come across this before with MySQL accepting column names that are reserved words. Try changing the column name to something else and try again. On Thu, 2002-04-18 at 18:34, Leif K-Brooks wrote: > I have a field in one of my tables called when, which is type timestamp. > I'm trying to use some of the date functions to get data from it, but it's > not working. The return from mysql_error() is not helpful. Any ideas? > Here's my query: > $query = mysql_query("select month(when) as month,year(when) as > year,dayofmonth(when) as day,hour(when) as hour,minute(when) as > minute,second(when) as second from table") or print "Error: ".mysql_error(); > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- Paul Edmondson, Software Engineer Yospace: Creating Value for Wireless 7 The Courtyard, High Street, Staines, UK, TW18 4DR Tel: +44 1784 466388 Fax: +44 1784 466387 http://www.yospace.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Any idea what's wrog with this query?
I have a field in one of my tables called when, which is type timestamp. I'm trying to use some of the date functions to get data from it, but it's not working. The return from mysql_error() is not helpful. Any ideas? Here's my query: $query = mysql_query("select month(when) as month,year(when) as year,dayofmonth(when) as day,hour(when) as hour,minute(when) as minute,second(when) as second from table") or print "Error: ".mysql_error(); -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] complicated transtable problem
Hi there, I am still struggling with following problem: There are two tables in mysql 1. city fields: ID, countryid, provinceid, city containing 2.5 million entries. 2. province fields: ID, countryid, provinceid, provincename Now there are some cities without a valid province id in the other table. Means that those city do not find the right province name. I would like to: 1. delete those province rows (all belonging to this country) in the province table 2. set the province_id to "" in the city table. Seems to be complicated.. maybe someone could give me a hint on this Thanx, Andy -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Import/Export data
Hi, How can I import/Export data to MySQL database using PHP following formats: EDI, Access, Excel ? Where can I find information about this ? Thanks, Rosen Marinov -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP and OCI NLS behaviour
HI, I use SuSE.6.4 with Ora.8.1.6/PHP.4.0.6. For a while, it used to be PHP/4.1.2, but I reverted to PHP/4.0.6 because of other non-Ora related problems. /etc/rc.d/apache startup script extract below # # set values for Oracle (need to recompile mod_php with Oracle support) # export ORACLE_SID=ORCL export ORACLE_BASE=/opt/oracle export ORACLE_HOME=/opt/oracle/product/8.1.6 export ORA_NLS33=/opt/oracle/product/8.1.6/ocommon/nls/admin/data export LD_PRELOAD=/usr/lib/libpthread.so export NLS_LANG=american_greece.el8iso8859p7 #export ORACLE_HOME=$ORA_HOME LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib # # export variables for database drivers in PHP # export DBROOT ORACLE_HOME LD_LIBRARY_PATH Never had any problem with Ora chars with _this_ setup. Are you 100% certain you have installed everything alright? All necessary re-compilations have been done? -Stathis. Miguel Carvalho wrote: > > > The speed decrease is dependant on your setup. How fast your machines > > are and how good your network is. I ran a few quick tests on our > > servers and there seemed to be little effect on performance. The loss > > of > > performance was unmeasurable. > > > > I see that it's a minor issue. > > > I'm not sure on the character set setting. You can see your current NLS > > settings for your session, instance and database by querying > > NLS_SESSION_PARAMETERS, NLS_INSTANCE_PARAMETERS and > > NLS_DATABASE_PARAMETERS. Maybe that well help you. > > I have done a select from those table/view...and all are as i need. > > A have tried changing the session parameters with alter session, but the > result is the same. > > Isn't this an issue related to OCI8 or PHP. > As i said at some days ago, this only appens on my Linux( suse 7.x) machine > that is using PHP. On the windows machines, all is fine. > > Does any can send me an exemple of the definition of NLS_LANG environment > variable? > > > Thank's for the repply > > Regards > Miguel Carvalho > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- +--+ |..| |||| || Stathis|| ||Rouvas || |||| |++| +-....-+ .--. / /\ \ / /==\ \ /\ \/ [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] appending new entry to old entries
Ron, Are we talking about appending new values to the database tables? If yes, you need to use INSERT INTO ... VALUES syntax ... If you mean to append the new values to a file , then you need to open the file in "a" mode. Gurhan -Original Message- From: Ron Allen [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 18, 2002 4:52 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] appending new entry to old entries I would like to make it so that my helpdesk section can append entries in their Master Station Log. Update replaces the entryany clues?? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] appending new entry to old entries
Not sure if you're asking whether you can append info onto the end of a database field without having to get the previous information, but you can. UPDATE table SET MyField=CONCAT(MyField,'Appended Text') WHERE Some_ID=5; That would update the row identified by Some_ID = 5, and append "Appended Text" to the end of MyField without a query to get the previous values. For numeric fields, you can also increment them like this: UPDATE table SET MyNumericField = MyNumericField + 1; That would update all rows in table, incrementing every row's MyNumericField value by 1. - Jonathan -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 18, 2002 2:27 AM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] appending new entry to old entries On Thursday 18 April 2002 16:51, Ron Allen wrote: > I would like to make it so that my helpdesk section can append entries in > their Master Station Log. Update replaces the entryany clues?? You would have to get the original value, append the new stuff then do UPDATE. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* There is very little future in being right when your boss is wrong. */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Puzzeling a little...
Hey. I am making a system to publish newsarticles, send newsletter and 12 - 14 other functions/modules. I've been working on it for almost two years, therefore some of the code is pretty old. Now, I want to create a set of tables controlling what is beeing displayed in the site's menu and administrationmenu. I want to make a "module" system, having all of the info about urls and menu-titles in the db instead of in html. This will cause the db to be queried every time the menu or the adminmenu is displayed... Which is.. All the time. My question is, do you think this is essentially a bad thing? It sure makes administration easier, but I am wondering if this will affect perfomance (alot)? I figure the menu will consist of 7 - 8 menu categories, each having three to four links in it... Just have to ask u guys, instead of just going at it alone, only to discover I made a big mistake... Med vennlig hilsen Trond Erling Hundal Daglig leder Epost: [EMAIL PROTECTED] Internett: www.innovationmanagement.no Telefon: 73 54 03 80 Mobil: 918 41 117 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] drop list inserts
Barry, All I saw was $artist_name variable that will be passed thru the form.. Can you do a echo $music_artist.id to see if it has a value .. And you still need to get rid of "$query_id = " in the line that you are trying to do insert. Gurhan -Original Message- From: Barry Rumsey [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 17, 2002 7:35 PM To: php-db list Subject: RE: [PHP-DB] drop list inserts The $music_artist.id is the id from the first page. ( database = music , table = music_artist id ). This is what I need, a drop down list of the artists in table 'music_artist'( I've got this), I want the id of the artist they selected in the drop list to be inserted into the table 'music_album' as $artist_id. -Original Message- From: Gurhan Ozen <[EMAIL PROTECTED]> To: Barry Rumsey <[EMAIL PROTECTED]>, php-db list Date: Wed, 17 Apr 2002 19:02:52 -0400 Subject: RE: [PHP-DB] drop list inserts > Hi Barry, > First of all, > $query_id = mysql_query("INSERT INTO...); is wrong. That line will > just > assign the resultset of the whatever mysql_query() function returns to > the > variable $query_id .. Get rid of $query_id and just have > mysql_query(INSERt > INTO ); See: http://www.php.net/manual/en/function.mysql-query.php > for > this.. > Second of all, in your INSERT INTO query you are trying to insert the > value > of a variable called $music_artist.id which doesn't exist anywhere. I > think > you meant to insert $artist_name instead??? > > Gurhan > > > -Original Message- > From: Barry Rumsey [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, April 17, 2002 6:23 PM > To: php-db list > Subject: [PHP-DB] drop list inserts > > > I have the following to pages( just testing them at the moment ): > mysql_select_db("music"); > echo " action='test-album-add.php'>"; > $getlist = mysql_query("SELECT * FROM music_artist ORDER BY > artist_name ASC"); > echo " Artist Name : \n"; > while ($row = mysql_fetch_array($getlist)) { > echo ' value="'.$row["id"].'">'.$row["artist_name"]."\n"; > } > echo " \n"; > echo "Album Name : value='$album'>"; > echo ""; > echo ""; > ?> > > and > > include("../mainfile.php"); > include("../header.php"); > OpenTable(); > > mysql_connect( "host", "", "" ); > mysql_select_db( "xoops" ); > > $query_id = mysql_query("INSERT INTO music_album VALUES > (NULL, '$music_artist.id' ,'$album' ,NULL ,NULL)"); > echo " $artist_name and $album has been added to the > database."; > CloseTable(); > include("../footer.php"); > ?> > > What I am trying to do is insert the id of the artist they selected in > the first page into a second table. At the moment all I get is 0 > inserted instead of the artist id from page 1. > > Could someone please point out what I'm doing wrong? > > Thanks in advance. > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Re: [PHP] Re: Cross DB application
Hi Manuel, I still don't see a problem in others telling their experiences with certain packages. If someone has just used metabase or has just used adodb then I would like to hear how easy/hard it was to port to another database. -Original Message- From: Manuel Lemos [mailto:[EMAIL PROTECTED]] Sent: April 18, 2002 9:37 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; Sp Subject: Re: [PHP-DB] Re: [PHP] Re: Cross DB application Hello, Sp wrote: > > Can someone with database expertise who has used metabase and adodb cut > through this rhetoric and give an objective view of these two packages. > From what I got from this convo is that metabase is slower but more portable > but adodb is faster but not as portable. No, Metabase does much more than ADODB. When you do more, eventually things may take a little longer when you do less. This should be obvious. Anyway, if you really care about portability, you're only way out is Metabase. Other abstraction packages were not meant for portability but rather for interface makeup. I think you will be the better judge of that if you try looking at least at each package documentation. It is pointless to ask to people here when most of them only know one or the other package. Regards, Manuel Lemos -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: [PHP] Re: Cross DB application
Hello, Sp wrote: > > Can someone with database expertise who has used metabase and adodb cut > through this rhetoric and give an objective view of these two packages. > From what I got from this convo is that metabase is slower but more portable > but adodb is faster but not as portable. No, Metabase does much more than ADODB. When you do more, eventually things may take a little longer when you do less. This should be obvious. Anyway, if you really care about portability, you're only way out is Metabase. If you are in doubt about the features, think at least about what you can do with each package to migrate your data when you decide to switch databases. Metabase is the only package that offer painless and failure proof method of migrating data using the XML schema support. With the other package you need to write custom scripts for migration which is a real pain and prone to error due to eventual bugs of software that you need to write on your own. Other abstraction packages were not meant for true portability but rather for interface makeup. I think you will be the better judge of that if you try looking at least at each package documentation. It is pointless to ask to people here when most of them only know one or the other package. You may also want to take a look at BinaryCloud which is a well designed and mature PHP application development framework. It works with Metabase and will save you countless hours of developing your applications from scratch. BinaryCloud http://binarycloud.tigris.org/ Metabase http://www.phpclasses.org/metabase Regards, Manuel Lemos -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: [PHP] Re: Cross DB application
Hello, Sp wrote: > > Can someone with database expertise who has used metabase and adodb cut > through this rhetoric and give an objective view of these two packages. > From what I got from this convo is that metabase is slower but more portable > but adodb is faster but not as portable. No, Metabase does much more than ADODB. When you do more, eventually things may take a little longer when you do less. This should be obvious. Anyway, if you really care about portability, you're only way out is Metabase. Other abstraction packages were not meant for portability but rather for interface makeup. I think you will be the better judge of that if you try looking at least at each package documentation. It is pointless to ask to people here when most of them only know one or the other package. Regards, Manuel Lemos -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Updating Many Records
I am not sure if this is possible. I have a database, and we fetch all the records and then list them. What we need is the one field in the database to be able to be updated. Now the field will have different values for each record. Is it possible to update the table with lots of different values? So for example we have: Field Qantity Book 1 5 Book2 6 Book3 9 Now when we are shown all these records the quantity is a form field and we want to change this but for each record? Hope the above is enough to go on. Barry -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP and OCI NLS behaviour
> The speed decrease is dependant on your setup. How fast your machines > are and how good your network is. I ran a few quick tests on our > servers and there seemed to be little effect on performance. The loss > of > performance was unmeasurable. > I see that it's a minor issue. > I'm not sure on the character set setting. You can see your current NLS > settings for your session, instance and database by querying > NLS_SESSION_PARAMETERS, NLS_INSTANCE_PARAMETERS and > NLS_DATABASE_PARAMETERS. Maybe that well help you. I have done a select from those table/view...and all are as i need. A have tried changing the session parameters with alter session, but the result is the same. Isn't this an issue related to OCI8 or PHP. As i said at some days ago, this only appens on my Linux( suse 7.x) machine that is using PHP. On the windows machines, all is fine. Does any can send me an exemple of the definition of NLS_LANG environment variable? Thank's for the repply Regards Miguel Carvalho -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] REG_BADRPT
Thanks David, I have sorted it. I was reading the reg expresion from a database and somebody added to the database something that I didn't make provisions for. Took me a while to see what was wrong. Thanks again. - Original Message - From: "David Robley" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, April 18, 2002 11:33 AM Subject: Re: [PHP-DB] REG_BADRPT > In article <005301c1e6b4$b67afde0$af00a8c0@cami>, [EMAIL PROTECTED] says... > > Does anybody know what this warning error means: REG_BADRPT? > > > > Cami > > > > Perhaps if you could post the bit of code that causes it? > > -- > David Robley > Temporary Kiwi! > > Quod subigo farinam > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] appending new entry to old entries
Thanks "Jason Wong" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]... > On Thursday 18 April 2002 16:51, Ron Allen wrote: > > I would like to make it so that my helpdesk section can append entries in > > their Master Station Log. Update replaces the entryany clues?? > > You would have to get the original value, append the new stuff then do UPDATE. > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > > /* > There is very little future in being right when your boss is wrong. > */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP and OCI NLS behaviour
On Wed, 2002-04-17 at 22:54, Miguel Carvalho wrote: > > > > Or if that is not available for you to edit you could always try just > > executing a statement to alter the session once a database connection > > is established. This method is a little slower. > > How slower? Very very slower? Can you give me an aproximation in seconds? The speed decrease is dependant on your setup. How fast your machines are and how good your network is. I ran a few quick tests on our servers and there seemed to be little effect on performance. The loss of performance was unmeasurable. > > >As you will have to > > execute the alter session statements every time you make the > > connection. > > Ok. > > > > > The SQL is something like: > > alter session set NLS_LANGUAGE = 'AMERICAN' NLS_TERRITORY = 'AMERICA' > > Can i specify the characterset on the alter session? > Sorry for the question...but the Oracle docs that i have read, just say > what is the sintaxe. > > Regards > Miguel Carvalho > I'm not sure on the character set setting. You can see your current NLS settings for your session, instance and database by querying NLS_SESSION_PARAMETERS, NLS_INSTANCE_PARAMETERS and NLS_DATABASE_PARAMETERS. Maybe that well help you. -- Paul Edmondson, Software Engineer Yospace: Creating Value for Wireless 7 The Courtyard, High Street, Staines, UK, TW18 4DR Tel: +44 1784 466388 Fax: +44 1784 466387 http://www.yospace.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] REG_BADRPT
In article <005301c1e6b4$b67afde0$af00a8c0@cami>, [EMAIL PROTECTED] says... > Does anybody know what this warning error means: REG_BADRPT? > > Cami > Perhaps if you could post the bit of code that causes it? -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: newsletter
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > hi guys, > i wanna make a news letter as follows: > i sell items within certain categories,so whenever a buyer is registered he choose >some categories to contribute to my newsletter with: > whenever a new item is added within this category i send him an email with that. > > i'm storing the mails in database. > > does anyone have something like this that can help me?? > > i tried in my script that whenever an item is added i send aletter to all who is >subscribed under this category,but i need to know the ID of this item that is added >first,so i faild to do that If you are using mysql, and have a table with an autoincrement key, you can use mysql_insert_id immediately after an INSERT to get the value of the last inserted id. -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] drop list inserts
Hi Barry, Barry Rumsey wrote: > $query_id = mysql_query("INSERT INTO music_album VALUES > (NULL, '$music_artist.id' ,'$album' ,NULL ,NULL)"); > echo " $artist_name and $album has been added to the > > Could someone please point out what I'm doing wrong? > is the value of $music_artist.id correct? Also, your has the name of "music_artist" and the value of the respective id, isn't that what you want? Regards, Christian -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] stored procedures with ODBC
Are there any consideration for a ODBC-Driver, which is able to handle the return values of stored procedures in PHP?? We´re using the new ODBC driver for the IBM DB2 which uses unixODBC and it works fine, even with stored procedures which produce temporary tables. For stored procedures which produce return values there is at the moment no way to handle this, because the variable binding functionality is missing? In the www I found an announcement from Grigoriy G. Vovk which has written a php-function to handle the return values from stored procedures. When I wrote him, he told me that has deleted the source code and interested in other non scripting stuff... So what´s about the return values of stored procedures, are there some considerations to get the stuff working for PHP?? It would be nice to have those functions for ODBC or IBM-DB2 generic functions... There is the workaround, calling a Perl-Script from PHP, but with the iSeries Driver released on March 2002 perl support is not included yet... So I´ at the moment a bit in a deadlock situation... Karl Prinz -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] appending new entry to old entries
On Thursday 18 April 2002 16:51, Ron Allen wrote: > I would like to make it so that my helpdesk section can append entries in > their Master Station Log. Update replaces the entryany clues?? You would have to get the original value, append the new stuff then do UPDATE. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* There is very little future in being right when your boss is wrong. */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] appending new entry to old entries
I would like to make it so that my helpdesk section can append entries in their Master Station Log. Update replaces the entryany clues?? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] REG_BADRPT
basically it means that you have an invalid regular expression pattern in a regex function. i think it's something to do with the . * ? + symbols - but just take a good look at your pattern and somewhere in there it is invalid :) HTH Beau // -Original Message- // From: Camelia Enderby [mailto:[EMAIL PROTECTED]] // Sent: Thursday, 18 April 2002 4:41 PM // To: [EMAIL PROTECTED] // Subject: [PHP-DB] REG_BADRPT // // // Does anybody know what this warning error means: REG_BADRPT? // // Cami // // // -- // PHP Database Mailing List (http://www.php.net/) // To unsubscribe, visit: http://www.php.net/unsub.php // -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] REG_BADRPT
Does anybody know what this warning error means: REG_BADRPT? Cami -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Extracting the essence!
Hi All. Thanx Lisi, it worked. But more to come. Have modified the code but, cant get the output i want. $test= preg_replace ($search, $replace, $dokument); while (list ($key, $val) = each($test)) { if ($key <= "5" || $key == "6") { //do nothing } else { echo $key = $val[1],$val[2],$val[3],$val[4], " " ,$val[5]; echo " "; } } Want to display the parsed tabel enteries in diferent ways. The table have dynamic updates and different lengths so I can't use the $val[x]. eg. one line reads before parsed: 1Dont want this entery to show. test1test1 want to truncate this to the 5 first letters test2show this 93 show the sum 9+3 68-33 show the sum 68-33 test3 show this Regards Stan - Original Message - From: "#Linux" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; "Lisi" <[EMAIL PROTECTED]> Sent: Sunday, April 14, 2002 11:24 PM Subject: Re: [PHP-DB] Extracting the essence! > Tanks so far, but if I want don't want to display the 1st and 4th line. > > > - Original Message - > From: "Lisi" <[EMAIL PROTECTED]> > To: "#Linux" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Sunday, April 14, 2002 10:55 PM > Subject: Re: [PHP-DB] Extracting the essence! > > > > > > >Try something like the following to extract the contents of the array by > > >looping through it: > > > > >$test= preg_replace ($search, $replace, $dokument); > > > > while (list ($key, $val) = each($test)) { > > echo $key = $val; > > } > > > > HTH > > > > -Lisi > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] troubles with select * from... to a ms-sql-server
hi, i try to get some data from our ms-sql-server the following statement: $SQL = "SELECT * FROM [ReferencesComplete]"; causes an error of the php.exe! i tried many various of this statement but nothing helped. ether it came no error and the [$result = mssql_query($SQL,$IDconnection);] variable was false or the php.exe crashed! with mysql it workes ok but with the ms-sql-server not! please give me help - this so what simple - but does not work - i lost so much time... hermann -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php