Re: [PHP-DB] Re: Subject: Accessing last inserted record in a PSQL Database table
Neil Smith [MVP, Digital media] wrote: At 23:50 26/11/2007, you wrote: Date: Mon, 26 Nov 2007 18:19:07 -0600 Reply-to: [EMAIL PROTECTED] [EMAIL PROTECTED] Message-ID: [EMAIL PROTECTED] I need to access the last inserted record in a postgresql database table from php. I connect to the db using pg_connect I construct the query string, and I use pg_query to send the query. I get the record inserted, of course. One of the fields, which is my primary key, is an autoincrement field. I need to fetch this value. Any idea? I would really apreciate your helping me. SELECT primary_key_name FROM database_table ORDER BY primary_key_name DESC Just use whatever cursor or LIMIT you can in Postgres to get a single record. If it's autoincrement, then the last record ordered in descending order is, the last record ;-) Not unless you wrap this (and the rest of your insert) in a transaction. session 1: adds a record session 2: adds a record session 1: tries to fetch last primary key - gets it wrong. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: Subject: union/select statement number of columns
Good man. That' probably what he really wanted to do. On 10/21/07, Neil Smith [MVP, Digital media] [EMAIL PROTECTED] wrote: At 19:31 19/10/2007, you wrote: Message-ID: [EMAIL PROTECTED] Date: Fri, 19 Oct 2007 09:24:38 -0600 Subject: union/select statement number of columns Hello all, I receive an error of the following: The used SELECT statements have a different number of columns. Any help, pointers, tutorials are appreciated. That's *completely* wrong SQL for what you're trying to do. Reading between the lines (you didn't say what you *really* want to do), you seem to want one order_item row and the details about its order for each order item. Your query needs to be : SELECT orders.*, order_items.* FROM orders LEFT JOIN order_items ON orders.order_id = order_items.order_id UNION is completely the wrong thing here - it can only compare identical things, you're trying to join together two different data columns (order, and order_items details) HTH Cheers - Neil Here are the two tables structure I am trying to pull from: Table 1 mysql describe orders; ++--+--+-+-++ | Field | Type | Null | Key | Default | Extra | ++--+--+-+-++ | id | int(255) | NO | PRI | | auto_increment | | ordernum | int(10) | NO | | || | date | varchar(60) | NO | | || | time | varchar(20) | NO | | || | group | varchar(20) | NO | | || | purpose| varchar(255) | NO | | || | tracking | varchar(120) | NO | | || | contact| varchar(255) | NO | | || | eta| varchar(50) | NO | | || | department | varchar(125) | NO | | || | notes | varchar(255) | NO | | || ++--+--+-+-++ 11 rows in set (0.01 sec) Table 2 mysql describe order_items; +-+---+--+-+-++ | Field | Type | Null | Key | Default | Extra | +-+---+--+-+-++ | id | int(11) | NO | PRI | | auto_increment | | ordernum| int(124) | NO | | || | quantity| int(124) | NO | | || | description | varchar(124) | NO | | || | price | decimal(10,0) | NO | | || | partnum | varchar(255) | NO | | || | vendor | varchar(255) | NO | | || +-+---+--+-+-++ 7 rows in set (0.00 sec) And here is the statement I am using (PHP): $query = ( SELECT * FROM `orders` WHERE ( `ordernum` LIKE $var\ OR `purpose` LIKE \$var\ OR `tracking` LIKE \$var\ OR `contact` LIKE \$var\ OR `date` LIKE \$var\ OR `time` LIKE \$var\ OR `eta` LIKE \$var\ OR `department` LIKE \$var\ OR `notes` LIKE \$var\ ) AND `group` = \$group\ ) UNION ( SELECT * FROM `order_items` WHERE ( `ordernum` LIKE \$var\ OR `price` LIKE \$var\ OR `partnum` LIKE \$var\ OR `vendor` LIKE \$var\ OR `quantity` LIKE \$var\ OR `description` LIKE \$var\ ) ORDER BY `ordernum` ); -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: Subject: screen resolution!
I suggest you use JavaScript rather than PHP, because when using server side scripts, you most probably need to use functions/variables out of the Document Object Model (DOM). When you use JavaScript, no extra trafic is generated on the network/internet, and that isn't even necessary! Specificaly, use the javascript variables document.body.clientWidth|clientHeight, inside a JavaScript. When these variables, that represent the number of pixels of the browser-window, are read, then you can draw anything to the screen that fits into these values of pixels. You don't need separate css-stylesheets or tables, as mentioned by the other posters in this thread! E.g. script language=JavaScript !-- alert(document.body.clientWidth); // displays the width of the // browser-window -- /script (I allready posted this message, but it was only sent to JeRRy. Oops!) - Original Message - From: Neil Smith [MVP, Digital media] [EMAIL PROTECTED] To: php-db@lists.php.net Sent: Sunday, February 05, 2006 7:17 PM Subject: [PHP-DB] Re: Subject: screen resolution! At 08:41 05/02/2006, you wrote: Message-ID: [EMAIL PROTECTED] Date: Sun, 5 Feb 2006 02:44:19 +1100 (EST) From: JeRRy [EMAIL PROTECTED] To: php-db@lists.php.net MIME-Version: 1.0 Content-Type: multipart/alternative; boundary=0-733704850-1139067859=:48594 Content-Transfer-Encoding: 8bit Subject: screen resolution! Hi, I have written a website in PHP using MYSQL. But I have come accross an un-common problem. Normally when I create a website it's done on a desktop PC. But this time for the first time I did it on laptop meaning the screen resolution is different. Is there any sort of script/code I can use to create another section of my site in a desired screen resolution without me having to do it all manually? I would really recommend that screen size / resolution detection is no longer the way forward. It's perfectly possible to use CSS +/- XHTML correctly to have the page reflow without all the stylesheet switching hacks that would be required in the 'old school' (read : 1999) way of doing things. You'd need to use structural markup rather than try to 'force to fit' with tables etc, but it's entirely possible to generate flexible layouts that can display on any device, even a PDA, without screen size detection. Search engines like sematic layout too, and your menu for example may not be the first thing they or a screen reader encounters in the page - though it may *appear* at the top of the page due to CSS telling it where to be displayed. Here are some links for you to consider : all are worth reading and digesting from end to end. http://glish.com/css/8.asp http://www.alistapart.com/stories/journey/ http://www.positioniseverything.net/articles/onetruelayout/ http://www.csszengarden.com/ I know of many scripts online that I can DETERMINE visitors screen resolutions and recommend the ** Assuming javascript is turned on, or even the display device supports that detection. And bear in mind, many users *may not wish* to have their browser maximised just to view your site. HTH Cheers - Neil -- 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: Subject: Scrolling News
Thanks for that, it does look great, however I seem to be encountering some problems with it and alas I can't seem to find the problem. The code for the header (which is where this is located) is ?php require_once('../Connections/Connection1.php'); ? ?php mysql_select_db($database_Connection1, $Connection1); $query_News = SELECT ss_news.news_title FROM ss_news ORDER BY ss_news.news_date; $News = mysql_query($query_News, $Connection1) or die(mysql_error()); $row_News = mysql_fetch_assoc($News); $totalRows_News = mysql_num_rows($News); ? !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 titleUntitled Document/title style type=text/css !-- body { background-color: #97AECE; } .scrollClass { text-align:center; font:normal 80% Arial,sans-serif; } -- /style /head script language=JavaScript !-- function var scroller1 = new scrollObject(scroller1, MainName, 120, 120, white, up, 1.35, 2.7, 30, 5000); { } //-- script language=JavaScript !-- scroller1.block[0] = This is block 1; scroller1.block[1] = This is block 2; scroller1.block[2] = Blocks can contain any HTML including:; scroller1.block[3] = Images, tables, links and more; scroller1.block[4] = Easy to configure, easy to run, with content automatically centred horizontally and vertically; scroller1.block[5] = Have any number of block scrollers running on a single page all with a single JavaScript; scroller1.block[6] = View the source for more info!; //-- /script /script body onLoad=scroller1.scroll(); div id=Layer1 style=position:absolute; left:29px; top:9px; width:35%; height:92px; z-index:1; background-color: #FF; layer-background-color: #FF; border: 1px none #00; div id=MainName The contents of this block will be displayed if the browser does not support the scroller. It will be overwritten if the scroller is supported. /div/div div id=Layer2 style=position:absolute; left:400px; top:10px; width:60%; height:60px; z-index:2; div align=rightimg src=../images/header.png width=450 height=60 border=0 align=right /div /div div id=Layer1 style=position:absolute; left:12px; top:3px; width:100%; height:47px; z-index:1;/div /body /html ?php mysql_free_result($News); ? Now, can you see the causes of these two errors... A runtime error has occurred. Do you wish to Debug, Line: 20 Error: Expected 9 And also A runtime error has occurred. Do you wish to Debug, Line: 36 Error: 'scroller1' is undefined. Any help on this issue is greatly appriciated. Regards, Alex On 23/12/05 11:16, Neil Smith [MVP, Digital media] [EMAIL PROTECTED] wrote: At 20:39 22/12/2005, you wrote: Date: Thu, 22 Dec 2005 20:38:58 + From: Alex Major [EMAIL PROTECTED] To: php-db@lists.php.net Message-ID: [EMAIL PROTECTED] Mime-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit Subject: Scrolling News Hi there. I'm trying to make a scrolling news box for my website. Basically I would like this news box to get information from a column in my database called 'news_title' and display it in a scrolling news box. Any suggestions for how to go about doing this? I'm still very new to php. Recommend : OrcaScroller (cross browser) http://www.greywyvern.com/javascript Block scroller and marquee Cheers - Neil -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: Subject: Scrolling News
snip Now, can you see the causes of these two errors... A runtime error has occurred. Do you wish to Debug, Line: 20 Error: Expected 9 Are you using pine to edit? Or a HTML editior. If HTML or notepad you have the option of turning wordwrap on/off. Use this to find line number. With PHP/Javascript knowledge you should be able to easily identify the problem. I just counted the lines in the email you posted for your code. Incidently you need to know how lines work in PHP in an email form, one line can carry to another line. Generally you look for the ; icon to end code, generally means a new enter but not all the time. But in a query state it does 99% of the time. I'll give you a hint, look at line 20 and think about adding a space or two. And also A runtime error has occurred. Do you wish to Debug, Line: 36 Error: 'scroller1' is undefined. It's undefined, define it, look on a javascript website for this error, explained nicely.Any help on this issue is greatly appriciated. Regards, AlexOn 23/12/05 11:16, Neil Smith [MVP, Digital media] [EMAIL PROTECTED] wrote: At 20:39 22/12/2005, you wrote: Date: Thu, 22 Dec 2005 20:38:58 + From: Alex Major [EMAIL PROTECTED] To: php-db@lists.php.net Message-ID: [EMAIL PROTECTED] Mime-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit Subject: Scrolling News Hi there. I'm trying to make a scrolling news box for my website. Basically I would like this news box to get information from a column in my database called 'news_title' and display it in a scrolling news box. Any suggestions for how to go about doing this? I'm still very new to php. Recommend : OrcaScroller (cross browser) http://www.greywyvern.com/javascript Block scroller and marquee Cheers - Neil Send instant messages to your online friends http://au.messenger.yahoo.com
Re: [PHP-DB] Re: Subject: Searching remote web sites for content
why do all that, if you know the address of the page that the link will reside on just curl that page for the results and preg_match that. -- Joseph Crawford Jr. Zend Certified Engineer Codebowl Solutions, Inc. 1-802-671-2021 [EMAIL PROTECTED]
RE: [PHP-DB] RE : Subject: Letters loop
This a better and small aproach!!! Thanks!!! -Original Message- From: Neil Smith [MVP, Digital media] [mailto:[EMAIL PROTECTED] Sent: Jueves, 26 de Mayo de 2005 07:35 a.m. To: php-db@lists.php.net Cc: [EMAIL PROTECTED] Subject: [PHP-DB] RE : Subject: Letters loop for ($i=1; $i=26; $i++) { print(chr(64+$i)); } chr() prints the ASCII character corresponding to that number. Upper case A-Z starts at 64 : http://www.lookuptables.com Cheers - Neil Date: Wed, 25 May 2005 20:37:47 -0700 From: MIGUEL ANTONIO GUIRAO AGUILAR [EMAIL PROTECTED] To: php-db@lists.php.net Message-id: [EMAIL PROTECTED] MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT Subject: Letters loop Hi!! I wanna a do a for loop with letters, Is this possible? for ($i = 'A'; $i = 'Z'; $i++){ // code } -- MIGUEL GUIRAO AGUILERA Logistica R8 - Telcel Tel: (999) 960.7994 Cel: 9931-6 CaptionKit http://www.captionkit.com : Production tools for accessible subtitled internet media, transcripts and searchable video. Supports Real Player, Quicktime and Windows Media Player. VideoChat with friends online, get Freshly Toasted every day at http://www.fresh-toast.net : NetMeeting solutions for a connected world. -- 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
[suspicious - maybe spam] [PHP-DB] [suspicious - maybe spam] RE: [PHP-DB] Re: Subject: Web Printing
http://www.fpdf.org/ Tutorial 2 furthermore, i really still can't see how PDF allows me to get my page number and total number of pages intermingled with my main contents. =( please advise.. thanks s much! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: Subject: Web Printing
Let me encourage you to be open minded about the use of dynamic PDF generation. Don't think PDF as in storage and downloading -- think PDF in the realm of format control. google class.ezpdf.php or just use this link: http://www.google.com/search?hl=enq=class.ezpdf.phpspell=1 Mark Cain - Original Message - From: Ng Hwee Hwee [EMAIL PROTECTED] To: PHP DB List php-db@lists.php.net Sent: Thursday, March 31, 2005 9:39 PM Subject: [PHP-DB] Re: Subject: Web Printing hi all, thanx for all your suggestions. however, the css below doesn't seem to help me solve my tfoot problem. if my tbody is pretty short, the tfoot will still NOT appear at the bottom of my page but it appears where my tbody ends (which sometimes ends in the middle of my page). what else can i do?? by the way, i cannot use PDFs to generate my reports as suggested by many of you kind souls. This is because my clients just want to click on the Print Monthly Report button and i am suppose to fetch the relevant data from MySQL DB and print out the report.. they don't need to save them in Excel or PDF. It is restricted to printing off the IE browser. The problem that gives me the most headache is how can I know the total number of pages and the current page number, by using PHP?? I really need this because a report can be hundreds of pages so page number is very important to my clients. Please kindly help me! thank you s much! Hwee - Original Message - From: Neil Smith [MVP, Digital media] [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, March 31, 2005 9:15 PM Subject: Subject: Web Printing At 10:27 31/03/2005 +, you wrote: Message-ID: [EMAIL PROTECTED] From: Ng Hwee Hwee [EMAIL PROTECTED] To: PHP DB List php-db@lists.php.net Date: Thu, 31 Mar 2005 18:24:41 +0800 Subject: Web Printing Hi all, i know i can print out a header and footer using HTML thead and tfoot. However, the tfoot doesn't always stay at the bottom of the page. For example, if the the last page only have 2 records, the tfoot will appear pretty high on the page. i am wondering how can i use PHP to fix the position of my header and footer PHP cannot help you here, it's the wrong tool for the job (it's a hammer not a screwdriver so to speak). You need to (*must* !!!) use CSS to position and specify the height and dimensions of the thead and tfoot thus : thead { display: table-header-group; position: absolute; top: 0; height: 36pt; width: 100%; } tfoot { display: table-footer-group; position: absolute; bottom: 0; height: 36pt; width: 100%; } These should apply *reasonably* well to position your thead and tfoot row groups in the same place on each printed page (adjust as desired). You *cannot* use PHP to guess the height of the page areas reliably unless you are using a fixed pitch font such as a dot matrix line printer. And even then it's somewhat guesswork (I've done both). But if we're assuming that you're users have laser printers you *must* use CSS to do the print layout, PHP line height guessing will not work for you. Cheers - Neil -- 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: Subject: Web Printing
hi! thanks for the suggestion.. actually i have tried PDF generation before and because my clients are japanese companies, the japanese characters don't get generated correctly.. i am still working on that but it doesn't seem that easy for me. furthermore, i really still can't see how PDF allows me to get my page number and total number of pages intermingled with my main contents. =( please advise.. thanks s much! hwee - Original Message - From: Mark Cain [EMAIL PROTECTED] To: Ng Hwee Hwee [EMAIL PROTECTED]; PHP DB List php-db@lists.php.net Sent: Friday, April 01, 2005 12:07 PM Subject: Re: [PHP-DB] Re: Subject: Web Printing Let me encourage you to be open minded about the use of dynamic PDF generation. Don't think PDF as in storage and downloading -- think PDF in the realm of format control. google class.ezpdf.php or just use this link: http://www.google.com/search?hl=enq=class.ezpdf.phpspell=1 Mark Cain -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Re: Subject: mysql - image storing
Ok Neil, I'll try this as well.I thought a readfile would be also forbidden by the htaccess, and I agree this would be a good solution.I don't really want to store the picture in the database but the fact is tha I should be able to do it if I want! About the protection: magic_quotes is off for me. That means that I have to protect the data I want to insert because it won't be done automatically So I don't unserstand Jason who says: Additionally, it should be noted that whether you need to use stripslashes() on data retrieved from the database depends on the setting of magic_quotes_runtime. The recommended setting is to have it disabled which means you do not need stripslashes(). magic_quotes is disabled, so I use addslashes for all my inserts and stripslashes when I retrieve them. For that picture, I tried using addslashes/stripslashes, mysql_real_escape_string for upload,addslashes only for upload (thanks Mike for the clear explanation about how it is stored, I was always confused about that, and apparently I won't need stripslashes anymore for retrieval :-) ) and nothing. So I would like to know if somebody has a very basic script for that that he is really using (very basic form just to ensure I can make it work as well), or if somebody can tell me what I'm doing wrong here... Thanks to everybody!! From: Neil Smith [MVP, Digital media] [EMAIL PROTECTED] To: php-db@lists.php.net CC: [EMAIL PROTECTED] Subject: [PHP-DB] Re: Subject: mysql - image storing Date: Wed, 19 Jan 2005 00:48:39 + No, really really , don't do this. Store the path to the image. You then load the path into PHP and use header(Content-type: image/jpeg); readfile($path_from_database); exit; Then .htaccess the *actual directory* you store the images in so it's hidden from browsing. Only allow authorised people access to their own images, using a standard authentication system, and retrieve the image filenames they're allowed from the DB, append that to your protected directory path, and use readfile() to pass through the file data directly to the browser. Really, don't store them in the database ;-) Cheers - Neil At 18:59 18/01/2005 +, you wrote: Message-ID: [EMAIL PROTECTED] From: mel list_php [EMAIL PROTECTED] To: php-db@lists.php.net Date: Tue, 18 Jan 2005 11:30:12 + Mime-Version: 1.0 Content-Type: text/plain; format=flowed Subject: mysql - image storing Hi list, I try to store/retrieve pictures into MySQL. I know that a lot of people will say this is not a good practice, so here are briefly my reasons: -I want to protect that pictures (restricted access) -I don't want to use htaccess as I want my users to be able to modify their password whenever they want, and I don't want to modify dynamically an htaccess file. -I could store them on the filesystem (my actual solution), but I have only few pictures, so I would like to give the MySQL option a trial. _ It's fast, it's easy and it's free. Get MSN Messenger today! http://www.msn.co.uk/messenger -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Re: Subject: mysql - image storing
At 09:48 19/01/2005 +, mel list_php wrote: Ok Neil, I'll try this as well.I thought a readfile would be also forbidden by the htaccess, No, .htaccess affects public viewing of the web root and child folders. PHP operates on the web server's file system (in as far as your host/ISP permits that) so the two areas are complementary. Infact, you could store the files entirely outside of the web root if you have access to such space on the machine - using readfile, as long as you have filesystem permission to traverse to the desired directory, then you can read and pass through the file using PHP. Then you'd not need .htaccess at all, it only comes into play when you're file-hiding beneath the web root. and I agree this would be a good solution.I don't really want to store the picture in the database but the fact is tha I should be able to do it if I want! No, really really , don't do this. Store the path to the image. You then load the path into PHP and use header(Content-type: image/jpeg); readfile($path_from_database); exit; Then .htaccess the *actual directory* you store the images in so it's hidden from browsing. Only allow authorised people access to their own images, using a standard authentication system, and retrieve the image filenames they're allowed from the DB, append that to your protected directory path, and use readfile() to pass through the file data directly to the browser. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Re: Subject: mysql - image storing
Hi Guys, Just to throw my 2 cents in... The application requirements drive how you handle images in a db...sometimes you simply don't have the choice (though filesystem storage is better IMO). My work app / clients require that we store images (and other media or documents) in the db. So while there are certain advantages to one over the other (and each method had them)...you do what the requirements tell you to do Bastien From: Neil Smith [MVP, Digital media] [EMAIL PROTECTED] To: php-db@lists.php.net CC: [EMAIL PROTECTED] Subject: [PHP-DB] Re: Subject: mysql - image storing Date: Wed, 19 Jan 2005 00:48:39 + No, really really , don't do this. Store the path to the image. You then load the path into PHP and use header(Content-type: image/jpeg); readfile($path_from_database); exit; Then .htaccess the *actual directory* you store the images in so it's hidden from browsing. Only allow authorised people access to their own images, using a standard authentication system, and retrieve the image filenames they're allowed from the DB, append that to your protected directory path, and use readfile() to pass through the file data directly to the browser. Really, don't store them in the database ;-) Cheers - Neil At 18:59 18/01/2005 +, you wrote: Message-ID: [EMAIL PROTECTED] From: mel list_php [EMAIL PROTECTED] To: php-db@lists.php.net Date: Tue, 18 Jan 2005 11:30:12 + Mime-Version: 1.0 Content-Type: text/plain; format=flowed Subject: mysql - image storing Hi list, I try to store/retrieve pictures into MySQL. I know that a lot of people will say this is not a good practice, so here are briefly my reasons: -I want to protect that pictures (restricted access) -I don't want to use htaccess as I want my users to be able to modify their password whenever they want, and I don't want to modify dynamically an htaccess file. -I could store them on the filesystem (my actual solution), but I have only few pictures, so I would like to give the MySQL option a trial. CaptionKit http://www.captionkit.com : Production tools for accessible subtitled internet media, transcripts and searchable video. Supports Real Player, Quicktime and Windows Media Player. VideoChat with friends online, get Freshly Toasted every day at http://www.fresh-toast.net : NetMeeting solutions for a connected world. -- 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: Subject: Javascript Question (Was PHP / Javascri pt question)
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm On 16 November 2004 15:12, Neil Smith wrote: That if (df[i].checked=true) { should of course read if (df[i].checked==true) { No it shouldn't -- it should read if (df[i].checked) { More efficient, more readable, and, more important, The Right Way (TM)! ;) Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Headingley Campus, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: Subject: grabbing text from a webpage and putting it in a query.
On Monday 05 January 2004 12:33, JeRRy wrote: Hi Neil, Could you please send me the code again please? Seems like my email client did a wibble last night and lost all my emails. :( Sorry about that. If it was a list posting from Neil that you require then look it up the archives. If you're requesting a resend of a private mail from Neil, shouldn't you be making this request in private? -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-db -- /* Where will it all end? Probably somewhere near where it all began. */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: Subject: file upload into mySQL
I am rewrite code again and success to upload into server. But I do not think I can upload filer into mySQL. I still can not get whether my SQL, marked on red, is correct or not. I would like to insert binary file into b_col blob filed. Please see my code: if (isset($_FILES['UploadedFile'])){ $original_tmp = $_FILES['UploadedFile']['tmp_name']; $original_name = $_FILES['UploadedFile']['name']; $original_type = $_FILES['UploadedFile']['type']; $original_size = $_FILES['UploadedFile']['size']; //$uploaddir = '/home/www/jp.siligate.com/php/t/'; // $original = $uploaddir. $_FILES['UploadedFile']['name']; $original = $_FILES['UploadedFile']['name']; move_uploaded_file($original_tmp, $original); $sql_insert = INSERT INTO objects VALUES ('$original','$original_name','$original_size','$original_type',now()); mysql_query($sql_insert); Also I forget to write typt file in table: create table objects { b_col blob, name varchar(30), file_size varchar(30), file_type varchar(30), file_date datetime } The result is that it shows blow; File Name : File Size : File Type : File Date : logo2.gif 1375image/gif 2003-12-27 05:06:22 ee.txt 0 application/octet-st 2003-12-27 04:59:04 rer.pl 0 application/octet-st 2003-12-27 04:53:32 tgt.java 0 application/octet-st 2003-12-27 04:49:05 oko.cc 0 application/octet-st 2003-12-27 04:46:54 xyz.pdf 0 application/octet-st 2003-12-27 04:42:43 Can you help me your good advice. Regards, Hiro
Re: [PHP-DB] no subject
On Saturday 08 June 2002 07:02, Tony wrote: Please enter a subject when you post. I have a huge database that some of the content need to be update weekly or even daily. I wrote a PHP script for that purpose. It's supposed to get the data from database, find the URL, fopen() it, find the information, then update it back into the database. Unfortunately, everytime I run the script I get an error message from browser saying attempt loading page MyPage's URL failed. Some guy indicated the problem is probably caused by PHP execution timeout. I tried to set the time longer, no luck. Tried to use flush() after each data, no luck. If this is a php-db question post your code ... Now I gotta think of other ways to do this. I am thinking about using AppleScript (I am using OS X). Does anyone know how to communicate with MySQL via AppleScript, if possible? Thanks. ... if it's an AppleScript question, post on the AppleScript list (assuming there is one). -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* share, n.: To give in, endure humiliation. */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php