[PHP-DB] LEFT JOIN in UPDATE
hi...trying to circumvent the limitation of the DELETE statement only being able to use its own table...idea is to mark the records to be deleted via an UPDATE statement which allegedly accepts LEFT JOIN and then performing the DELETE statement. Question is how to properly form a LEFT JOIN using UPDATE... I tried: UPDATE product_price LEFT JOIN temp SET product_price.product_price_vdate = 1 (del flag) ON product_price.product_id = temp.product_id WHERE temp.product_id IS NOT NULL as well as some other combos...to no avail! Anyone used this know the right syntax much appreciated!!! Luis = Make it idiot-proof and someone will make a better idiot. __ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] DELETE in mysql?
Thanks to those who replied...but I was hoping perhaps of a creative idea in solving the problem of deleting from multiple tables...I can't believe I will have to delete 265 records (x 3 tables) by hand... is there any other way out? I cannot install version 4 since it is on a hosted site. Thanks --- Adv. Systems Design [EMAIL PROTECTED] wrote: Maybe my example attempt is misguided but the idea is to look up the prod_id from temp to know which records to delete in the prod, prod_price, prod_cat tables, all having the prod_id field as a link...just like you can do in a SELECT statement: select p.product_id, p.product_price from product_price as p, temp as t where t.product_id = p.product_id Let me know if what I am asking is unclear. --- Rick Emery [EMAIL PROTECTED] wrote: You cannot refer to other tables. Which row in temp would MYSQL know to refer to test the WHERE clause? That is, if temp has multiple rows, which row in temp would MYSQL check against to determine prod_id? -Original Message- From: Adv. Systems Design [mailto:[EMAIL PROTECTED]] Sent: Friday, February 01, 2002 2:43 PM To: PHP List Subject: [PHP-DB] DELETE in mysql? sorry if this is painfully obvious but I can't seem to figure it out...It seems to me (unless I am reading it waay wrong) that the mysql DELETE command does NOT allow you to refer to columns from other tables! I have identified certain records to be deleted from 3 tables and created a temp table to hold the item_id's to look up and delete...BUT HOW?! Ideally it would be: DELETE FROM prod, prod_price, prod_cat WHERE temp.prod_id = prod.prod_id AND temp.prod_id = prod_price.prod_id AND temp.prod_id = prod_cat.prod_id TIA Luis = Make it idiot-proof and someone will make a better idiot. __ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] = Make it idiot-proof and someone will make a better idiot. __ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] = Make it idiot-proof and someone will make a better idiot. __ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] DELETE in mysql?
sorry if this is painfully obvious but I can't seem to figure it out...It seems to me (unless I am reading it waay wrong) that the mysql DELETE command does NOT allow you to refer to columns from other tables! I have identified certain records to be deleted from 3 tables and created a temp table to hold the item_id's to look up and delete...BUT HOW?! Ideally it would be: DELETE FROM prod, prod_price, prod_cat WHERE temp.prod_id = prod.prod_id AND temp.prod_id = prod_price.prod_id AND temp.prod_id = prod_cat.prod_id TIA Luis = Make it idiot-proof and someone will make a better idiot. __ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] UPDATE query to add to a field
hello all: I need to be able to update a field in MySQL, the catch is that I have to add on to text that is already there and I have to be able to do it within MySQL (phpMyAdmin). My first idea was to do: SET prod_desc = prod_desc + more info to tack on to end but this is a mathematical function which returns 0! Any ideas? Thanks Make it idiot-proof and someone will make a better idiot. - Do You Yahoo!? Yahoo! Auctions Great stuff seeking new owners! Bid now!
[PHP-DB] PHP and MSSQL using APACHE
Hello all: Just have been tasked to port an app created on (linux)php/mysql/apache to run (on Win2K) php/mssql/apache. Any links with info on setting up mssql to work with php and apache (all on win2k) appreciated! Luis __ Do You Yahoo!? Find the one for you at Yahoo! Personals http://personals.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] inserting NULL value
Hello * I am trying to batch load data into MySQL 3.23.39 from data that I am preparing using MS Excel, converting to tab-delimited txt file and uploading using phpMyAdmin... ...the problem is in trying to load the NULL value for some columns...if I leave the column empty it just gets truncated, and even if I put something into the first cell of the null column, half ways down the tab delimited file, excel just drops the field...if I use the word NULL, the value appears in the db as NULL not as . ...how do you batch load NULL values? Thanks Luis __ Do You Yahoo!? Make a great connection at Yahoo! Personals. http://personals.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] CASE tool
Hi: Anyone offer recommendations for a CASE/E-R modeling/Data dictionary tool that can be used with MySQL? Thanks Luis __ Do You Yahoo!? Get email alerts NEW webcam video instant messaging with Yahoo! Messenger. http://im.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Table display Driving me Crazy!
I figured out what was wrong...and yes, the db call was from phplib...I am making modifications to existing code and so haven't figured out all the inns and outs...what I did was just create an array from the object that was being called by the query and then addressed those array elements individually here is a sample: ? for ($l = 1; $l = $numcols; ++$l) { if ($int_j = $int_i){ ? td width=139 class=ModNo bordercolor=#00?php echo $array_sku[$int_j]; ?/td ? } //endif $int_j++; } //endfor ...sorry if the code looks like crap but yahoo tends to truncate the width... thanks anyways! Luis --- Jason Wong [EMAIL PROTECTED] wrote: The whole block is wraped in a while ($db-next_record()) { ...} loop actually. Now, I'm not sure if the next_record() method is setting an internal member to the current record and returning TRUE/FALSE for success, or if it's actually supposed to be returning a row. It should be the former. But whatever it does, it doesn't change the fact that the code for displaying the 1st, 2nd and 3rd rows are in fact displaying a constant for each of the 5 columns. I'm guessing the class is simply being mis-used. The code is reasonably logical assuming next_record() is setting an internal member variable to the current row... doesn't look like it is though. If I'm not mistaken it looks to be using the phplib library. I believe it *is* being used correctly but he doesn't seem to be choosing the correct fields to display. I know with ASP/VBScript that there's a decent performance hit when you jump from HTML to VbScript and back again... I would imagine though not as severe the same also happens in PHP. Rather than stop the parser, print out something small like a /td and start the parser back up it's probably better performance wise to just use the 'echo' function (well, keyword, I guess echo isn't a real function, print is though). Plus, it makes your code more readable without all the ?php ? marks everywhere. In this case, yes, it's preferable to use echo. But if there are more than a few lines of html then using echo gets tedious pretty quickly (not mention having to escape all the s) :) regards -- Jason Wong Gremlins Associates www.gremlins.com.hk Tel: +852-2573-5033 Fax: +852-2573-5851 __ Terrorist Attacks on U.S. - How can you help? Donate cash, emergency relief information http://dailynews.yahoo.com/fc/US/Emergency_Information/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Table display Driving me Crazy!
Hello * trying to output mysql content into a table, but the table is designed to use 3 Trows to display info for ONE product (table also has to have 5 columns): row1 sku1|sku2|sku3|sku4|sku5 row2 img1|img2|img3|img4|img5 row3 nam1|nam2|nam3|nam4|nam5 - row4 sku6|sku7|sku8|sku9|sku10 row5 img6|img7|img8|img9|img10 row6 nam6|nam7|nam8|nam9|nam10 - etc... I have code that is displaying the right #of columns but it is simply repeating the product across the table... table width=100% border=1 cellspacing=0 cellpadding=0 bgcolor=#00 ?php $db-query($list); while ($db-next_record()) { ? tr bgcolor=#66 ?php $numcols = 5; for ($l = 1; $l = $numcols; ++$l) {? td width=139 class=ModNo bordercolor=#00?php echo $db-f(product_sku); ?/td ?php } ? /tr tr bgcolor=#ECEF7A ?php for ($l = 1; $l = $numcols; ++$l) { ? td height=80 bordercolor=#00 div align=centerA HREF=?php $sess-purl(URL . ?page=$flypageproduct_id= . $db-f(product_id) . category_id= . $db-f(category_id)); ? ?php $ps_product-show_image($db-f(product_thumb_image),); ?/A /div /td ?php } ? /tr tr bgcolor=#C9C62D bordercolor=#C9C62D ?php for ($l = 1; $l = $numcols; ++$l) { ? td class=prodName?php $db-p(product_name); ?/td ?php } ? /tr ?php } ? /table Anybody have any ideas how I can get this thing to work?! Thanks Luis __ Terrorist Attacks on U.S. - How can you help? Donate cash, emergency relief information http://dailynews.yahoo.com/fc/US/Emergency_Information/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] SQL query (OT)
hi: I have 2 tables, lesson and lesson_gle, where lesson holds lesson data and lesson_gle holds repeating data that are how the lesson correlates to various state standards (one lesson can have many correlations)...one particular lesson may have a math correlation as well as a language arts correlation. From a couple of popups, I am passing numerical values for $level and $subject which pertain to a certain level (grade level) and subject (the correlations). I am decoding them using an array which I use to construct the query you see below. The query is working fine, HOWEVER, it only looks at the first correlation of a lesson...so if I ask for math, all of the lessons that have math as a second correlation are not returned, and I would like to be able to show ALL lessons that have a MA correlation. SELECT * FROM lesson, lesson_gle WHERE lesson.l_id = lesson_gle.l_id $cluster[$level] GROUP BY lesson.l_id HAVING lesson_gle.glenum LIKE '$subjaray[$subject]%' ORDER BY lesson.l_id $cluster = array ( , AND (lesson.grdlevel = '1' OR lesson.grdlevel = '2'), AND (lesson.grdlevel = '3' OR lesson.grdlevel = '4' OR lesson.grdlevel = '5'), AND (lesson.grdlevel = '6' OR lesson.grdlevel = '7' OR lesson.grdlevel = '8'), AND (lesson.grdlevel = '9' OR lesson.grdlevel = '10' OR lesson.grdlevel = '11' or lesson.grdlevel = '12')); $subjaray = array (, LA, MA, SS, SC, AT, VA, PE, TH, MU, HE, DA, FL); Thanks Luis __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] (OT) SQL query repeats
hello: I have 2 tables...lesson and lesson_gle (which holds repeating data for lesson, i.e. l_id, glenum) the following query gets results, but there are repeated entries (one for every repeat in lesson_gle table) SELECT * FROM lesson, lesson_gle WHERE lesson.l_id = lesson_gle.l_id HAVING lesson_gle.glenum LIKE 'MA%' ORDER BY lesson.l_id Any ideas on how to get the data to not repeat? Thanks Luis __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] image resizing
Is there a way of sizing image resolution on the fly? TIA Luis __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Cookie is set?
anyone have a good method or code snippet to check if the user is accepting cookies? Thanks luis __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] AOL and Cookies (sessions) HELP!
I have a login procedure using php4 sessions that craps out when people try to login using the AOL browser...basically the AOL browser just ignores the cookie (due to a proxy server blocking it I think) and the user can't log in and they don't get any feedback about it either...they are just presented with the login screen...again!!! Is there a way to detect when the cookie was IGNORED and present the user with an alternate screen giving them info on the failure and steps to correct it? (The only way I know of correcting this is to tell the users to MINIMIZE the AOL browser and LAUNCH IExplorer) Luis __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] changing field size
hello *: I have initially set a field named title to be varchar(50)...I am finding that it is not long enough...can I change the size without adversely affecting existing data? Thanks Luis __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] User Permissions
Hello *: I have to code an app that must enforce user permissions in terms of data entry and editing (only certain records may be edited by certain people). I realize that each situation is unique, but does anyone have a starting place they recommend? TIA Luis __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] CodeCharge IDE (OT)
I accidentally entered php.org instead of php.net the other day when I was looking for the php man pages and came across the CodeCharge IDE...I know no tool can foresee all possible situations and therefore cannot be a panacea (or even useful), but I was wondering if there are any users of this tool out there, and what value do they find in it... Thanks Luis __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Where do I get started?
One of the best kept secrets (apparently) is to take a program that someone else has created (preferably a mature project that has undergone some growth and cleaning) and learn what it does...syntax is just that...you will see that there are about a million ways of doing any one thing, but only certain ways (coding style) will guarantee that your projects dont collapse on their own obfuscated methods. I must admit I am a newbie, but I have seen some excellent modular, clean code on this tutorial on building an ecommerce site (MyMarket). It is a great departure point for many projects: http://www.devshed.com/Server_Side/PHP/Commerce1/ hth --- Andrew Halliday [EMAIL PROTECTED] wrote: dont bother reading books...if you have coded any c,c++,java,just about any language these books are 80% fluff. All you need is the php manual, a project to start dabbling and this listreally. AndrewH - Original Message - From: "olinux" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, March 09, 2001 4:06 PM Subject: Re: [PHP-DB] Where do I get started? I enjoyed FAST AND EASY PHP by Julie Meloni [ www.thickbook.com ] and the PHP4 BIBLE [ www.troutworks.com/phpbook ] has served as a good reference. I am new so these are the only two i've read. I just picked up SAMS Teach Yourself SQL in 10 minutes. I know I have heard the books are crap, but i needed a quick references [ tiny little $13 book ] antoher great book is HTML 4: No Experience required by Sybex Books. olinux - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, March 08, 2001 4:59 PM Subject: Re: [PHP-DB] Where do I get started? I am also very knew at PHP/MySQL and have been busy populating my MySQL databases with tables (phpMyAdmin is a snap-LOL!). I am currently reading 3 different books on PHP, which also discuss use of MySQL as the back end: Essential PHP (Julie Meloni), Beginning PHP (Wrox), and Essential PHP for Web Professionals (Christopher Cosentino). I also bought a book appropriately titled MySQL by Paul DuBois as additional reference for the back end. Dont forget the web: There are also tutorials on the web that may help also. Steph _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] retrieval of NEXT, PREV records
I have set up links to browse records one by one, using (ID+1) for NEXT and (ID-1) for PREV...the only problem is that if there is a hole in the ID sequence (as from DELETION), there is no record returned...How can I have it so that the 'holes' are paved over and not returned? TIA Luis __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]