RE: [PHP-DB] Sorting Arrays
Mark Not exactly sure what you're after but will array_multisort() help? http://www.php.net/array_multisort Rich -Original Message- From: Mark @ Webbiz NZ [mailto:[EMAIL PROTECTED]] Sent: 28 January 2003 05:10 To: [EMAIL PROTECTED] Subject: [PHP-DB] Sorting Arrays Hello, I don't understand arrays that well. If someone can help me sort the contents it would be appreciated. I have data being retrieved from a text file and the fields as an array inserted into another array. orderby is numeric is 1-99 and requires sorting ASC content is just formatted html for instance : While Loop $a++ Get Data content orderby $marray[$a] = Array(content=$msort , orderby=$orderby[1]); End After this data is retrieved I would like to sort the information by the orderby field. Then the information is printed from the content field as per the sorted order foreach ($marray as $val) { echo $val['content']; } If someone can help me out, this would be appreciated. Regards Mark NZ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] MySQL Error
Hi Jordan Made any recent changes to your network configuration? Can you access other IP ports OK e.g. http port 80? Do you have any firewall protection on your PC? Can you access MySQL from the command line OK? Rich -Original Message- From: JordanW [mailto:[EMAIL PROTECTED]] Sent: 28 January 2003 04:37 To: [EMAIL PROTECTED] Subject: [PHP-DB] MySQL Error I'm getting this error message when I try the following code: $link = mysql_connect(localhost) or die(Could not connect); print (Connected successfully); mysql_close($link); The scripts outputs: Warning: Can't create TCP/IP socket (10106) in C:\Projects\WebServer\admin.php on line 3 Warning: MySQL Connection Failed: Can't create TCP/IP socket (10106) in C:\Projects\WebServer\admin.php on line 3 Could not connect Any ideas? Thanks -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] PHP and ORACLE conection error
hy, i'm having a problem with my project i have an oracle server on a computer named oracle and in apache htdocs files i have a directory special for my project... 1 in that dir i have a html file named index.html here i get the username and the password and post it to the validate.php file in the validate.php file: the first i have is ?php session_start(); header(Cache-control:private); ? then 1. i get the variables $name=$_POST['username']; $password=$_POST['pass']; 2. i register the variables session_register(name) and session_register(password), 3. i verify if they can acces to the database if( ociplogon($name,$password)) $ok='true'; else $ok='false'; 4. in the body of the validate.php i have a script in order to load a new page script var ok=?php echo $ok; ? if(ok==true) window.location.href=good_page.php; else window.location.href=error.php window.reload(); /script well that's it it works but not finei know it isn't the best way but it worked till some days i have any problems but since today i don't know what is happening... sometimes it works loading the good_page but sometimes it loads the error page i think it is something with authentification and session but i need a solution quickly...i have no time to rethink all... if you have a solution or another type of making all i have made send me a reply thanks a lot... cybercop78 http://www.idilis.ro - Stiri, e-mail gratuit, download, SMS, server de counter-strike, hosting gratuit, servicii internet... Fii cu un pas inaintea celorlati! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] problem with copy()
hi can the string source in copy () looks like that: c:\pic.jpg. If not than how should it look like. I'm not sure becouse script gives me Unable to open c:\pic.jpg for reading: No such file or directory but the file is there. and when i'm using $HTTP_POST_FILES['file']['tmp_name'] it returns me: 'Unable to open 'none' for reading: No such file or directory'. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] problem with copy()
AFAIK none is put into tmp_file when the file upload wasn't successful. Andrey - Original Message - From: Bartosz Matosiuk [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, January 28, 2003 2:07 PM Subject: [PHP-DB] problem with copy() hi can the string source in copy () looks like that: c:\pic.jpg. If not than how should it look like. I'm not sure becouse script gives me Unable to open c:\pic.jpg for reading: No such file or directory but the file is there. and when i'm using $HTTP_POST_FILES['file']['tmp_name'] it returns me: 'Unable to open 'none' for reading: No such file or directory'. -- 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] mysql_insert_id() vs. last_insert_id()
Hi I've been checking the last_insert_id() function out and I am curious. The MySQL docs say to use the mysql_insert_id() function after an insert into query to grab the key value. Both seem to work; however, there are some subtle differences. Which is the best one to use after a single insert statement, or does it matter? -- Randy Phillips www.phillips-it.com phillipsIT, L.L.C. voice: 636.390.9468 Senior Web DevelopereFax: 501.423.3817 -- Get SideKick - for MySQL - http://www.phillips-it.com/sidekick -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQL Error
Just a shot in the dark, but be sure the socket and port settings are correct for your setup (whatever that might be since you did not include that info in your post) and that mysql is actually running. Be sure to scour http://www.mysql.com/documentation/mysql/bychapter/index.html especially the section regarding running MySQL on windows. Sounds like a MySQL setup problem unrelated to PHP. JordanW wrote: I'm getting this error message when I try the following code: $link = mysql_connect(localhost) or die(Could not connect); print (Connected successfully); mysql_close($link); The scripts outputs: Warning: Can't create TCP/IP socket (10106) in C:\Projects\WebServer\admin.php on line 3 Warning: MySQL Connection Failed: Can't create TCP/IP socket (10106) in C:\Projects\WebServer\admin.php on line 3 Could not connect Any ideas? Thanks -- John Krewson Programmer - SWORPS -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] SQL very fast here very slow there
Is it possible that the tables at school are not indexed? berber -Original Message- From: Paolo Bonavoglia [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 25, 2003 7:55 PM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] SQL very fast here very slow there At 16:43 24/01/2003 24/01/2003, John A DAVIS wrote: We had a very sluggish SQL Server 7.0 and we tested the RAM chips and found one to be bad. It was throwing off a whole bank of chips (1gb). Stuff is a lot faster now. Also, your indexes might be different on your tables. Indexing the correct fields, especially the joined fields and ID fields used in searches, really helps big time. I'm no expert. At 16:32 24/01/2003 24/01/2003, Brent Baisley wrote: I'm not sure how Paradox works, but it may be locking problems you are running into. I know Paradox used to have issues with data changing while a query was executing. On your home machine you are the only one accessing the DB, so there wouldn't be any contention. Your home DB probably hits the cache since the data isn't changing. How busy is the DB at school? Thanks a lot for your suggestions; sometimes Paradox does have locking problem ... but the DB at school is not very busy, and the tables and web pages I am using are still private, in a password protected area. Indexes are identical So I'm still in doubt. I have checked RAM and indexes at school but everything seems Ok. And I've found something even more strange: I've splitted the SQL query in two: the first uses just the first two tables, and the output table is then visited with a PhP while {} loop which at every step execuste a simple SQL SELECT on the third table; I thought this a much less efficient method to make the web page, and so it is on my home PC, where it takes some 3 or 4 seconds to complete (instead of 1 sec or less); but on the school server the web page takes only 15-20 sec, a lot less than before (60sec and even more)! A 3 tables join is too much for the server?? So I've found a (not so good) solution to the problem, but I still do not understand it's nature and this is quite disappointing. There is really nothing in your question applicable to PHP. Have you tried a Paradox list? I'll try, but using the Paradox 9 program the SQL Select executes in a flash at home and at school, there is no measurable difference; maybe the problem is with the ODBC Paradox driver? Paolo Bonavoglia --- Docente di Matematica e Fisica Responsabile Lab.Informatica e sito Web Liceo Classico Marco Foscarini Cannaregio 4942 I 30121 VENEZIA Tel. 041,5224845 Fax 041,5201657 E-Mail [EMAIL PROTECTED] -- Pagine Web http://www.liceofoscarini.it/ -- 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] mysql_insert_id() vs. last_insert_id()
I've been checking the last_insert_id() function out and I am curious. The MySQL docs say to use the mysql_insert_id() function after an insert into query to grab the key value. Both seem to work; however, there are some subtle differences. Which is the best one to use after a single insert statement, or does it matter? It really doesn't matter. If you need the number in PHP for something else, then use the PHP function. If you just need it for another query, one right after the other, then use the MySQL function and don't worry about PHP retrieving it. ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] mysql_insert_id() vs. last_insert_id()
So I read this thread and the MySQL doc on mysql_insert_id() and still have a related question. Does mysql_insert_id() function on a per-connection basis? I read the stuff on last_insert_id() and it specifically mentions that the last ID is stored on the server on a per-connection basis. However, the info on mysql_insert_id() makes no such specific claim. The reason I ask is, if you use mysql_insert_id() on a busy server and it does not function on a per-connection basis, don't you run the risk of getting the last ID of somebody else's INSERT query on the server? -Original Message- From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 28, 2003 11:37 AM To: Randy Phillips; [EMAIL PROTECTED] Subject: Re: [PHP-DB] mysql_insert_id() vs. last_insert_id() I've been checking the last_insert_id() function out and I am curious. The MySQL docs say to use the mysql_insert_id() function after an insert into query to grab the key value. Both seem to work; however, there are some subtle differences. Which is the best one to use after a single insert statement, or does it matter? It really doesn't matter. If you need the number in PHP for something else, then use the PHP function. If you just need it for another query, one right after the other, then use the MySQL function and don't worry about PHP retrieving it. ---John Holmes... -- 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] mysql_insert_id() vs. last_insert_id()
So I read this thread and the MySQL doc on mysql_insert_id() and still have a related question. Does mysql_insert_id() function on a per-connection basis? I read the stuff on last_insert_id() and it specifically mentions that the last ID is stored on the server on a per-connection basis. However, the info on mysql_insert_id() makes no such specific claim. The reason I ask is, if you use mysql_insert_id() on a busy server and it does not function on a per-connection basis, don't you run the risk of getting the last ID of somebody else's INSERT query on the server? Yes, they are both on a per-connection basis. They'd be useless otherwise. ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Odd browser problem with sessions
I have a web site that is protected using sessions, and it works fine. Only occasionally when a end-user tries to log in using IE the login screen will just reload, every time they try to log in. I found that by closing IE (all windows) then trying again, it will go on to the proper page. This behavior appears to only effect IE, I saw it once on either Netscape or Mozilla (I don't recall which), and no one I've talked to on the phone has had this problem in any browser other than IE, and there have been many calls about this. Any idea what this might be caused by? Thanks, -- Chip Wiegand Computer Services Simrad, Inc www.simradusa.com [EMAIL PROTECTED] There is no reason anyone would want a computer in their home. --Ken Olson, president, chairman and founder of Digital Equipment Corporation, 1977 (Then why do I have 8? Somebody help me!) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Members area
Hi, If anyone else has any further ideas, please let me know - thanks. Thanks Jim for the nuke idea, I've downloaded it am looking through it... very exhaustive though... Thanks Jeff on your thoughts. I've been thinking along very similar lines to what you suggested... - I have a contents table plan to add a column authlevel (Authority Level), so that each page will have a defined minimum access. - I was thinking of creating a members table with username, password, authaccess. I liked the idea of leaving room for further growth, and the 'x = y' control rather than the 'if x = y' or case equivalent. - Establish an SSH session between the browser server for the session/cookie establishment when the username password are submitted (a lot of reading may be needed for this one I think...). - use either sessions to control the access, or cookies (from what I've read, people seem to favour sessions, I will have to do some reading before I make my choice). It is good to know there are others out there that are thinking in the same mannor for this... Let me know how you progress. Cheers, Gav -Original Message- From: Baumgartner Jeffrey [mailto:[EMAIL PROTECTED]] Sent: Thursday, 23 January 2003 9:05 PM To: [EMAIL PROTECTED] Subject: RE: [PHP-DB] Members area I'm working on a similar project - I'm also a newbie - here's my approach - which is fairly simple really. Create a database of all members that includes columns for login, name and paymentStatus as well as any other info you need for your database. paymentStatus would be an integer with values of 2 and 5 initially (this allows room for the creation of other levels in the future) in which 2 is for paid members and 5 is for free members. Once members log-in, their paid status is saved as a session variable: $paymentStatus. All member-area pages will start with session_start(); at the beginning and a check of the value of $paymentStatus. If it is null, they are sent to the log-in page. If the page is for members only, then the value of $paymentStatus must be =2. If it is for any member, then $paymentStatus will have to be =5 (this all gives room for different levels of membership in the future, you see). Likewise content, which is stored on tables, includes a $paid variable which indicates who is able to view it. This way, you can deliver dynamic content, links and other information according to the $paymentStatus value of each visiting member. In my case, I will have index pages with links to content pages. All links will be visible, but links for paid members will be clearly indicated. The purpose of this is to show freeloaders what they are missing! I hope this is clear. More experienced members of this list may well find flaws with my method. Good luck, Jeffrey Baumgartner eBusiness Consultant - ITP Europe http://www.itp-europe.com [EMAIL PROTECTED] +32 2 721 51 00 -Original Message- From: Gavin Amm [SMTP:[EMAIL PROTECTED]] Sent: Thursday, January 23, 2003 2:03 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Members area Hi All, I'm about to start development on a members area for a site. The members area will have 2 levels - Paid Free, with the Paid members having access to more pages. I have not created a members area before am after any advice or links I can get... I think a lot of reading is in order... Particularly: - DB structure fields (I'll be using MySQL if that's relevant) - Sessions (I've seen quite a few threads covering sessions over the last couple of months, so should have some links in my 'inbox' somewhere... But the more the merrier...) - Any PHP suggestions/advice/links - Anything else you can think is relevant... Thanks, this will be a big help. Cheers, Gav -- 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-DB] really stumped!
hello and thank you for taking a look at this. i, no matter what id do can not get variables to echo a value or inserted into my db. i uploaded the original file and parse error line by parse error line had to remove all brackets, which doesn't make sense to me right now, except for the two encompassing header:. one of many forms submitted to this will actually process and post now with no errors but will not, as i mentioned, print any of my echo. here is the thing in it's entirety and i very much appreciate your time and efforts. best regards, addison ellis ? session_start(); if (@$auth != yes) { header(Location: login.php); exit(); } include(config.php); $sql = SELECT first_name,last_name FROM accounts WHERE email='$logname'; $result = mysql_query($sql) or die(Couldn't execute query 1.); $row = mysql_fetch_array($result,MYSQL_ASSOC); extract($row); echo headtitleCreate an Ad/title/head h3 align='center' style='margin-top: .05in' $first_name $last_name/h3; echo id=$id, HTTP_POST_VARS=$HTTP_POST_VARS, key=$key, value=$value, category=$category, subcategory=$subcategory, logname=$lognamebr; foreach ($HTTP_POST_VARS as $key = $value) $key = stripslashes($key); /* is there a better way to do this? the below if ($key !=...) are all fields from all the various forms that submit to this page that are not required to be filled in. so if ($value == ) checks all the other fields, which are the required fields. there are almost as many required as not, so i opted to go with if ($key !=...)*/ if ($key != destination and $key != depart_city and $key != quantity and $key != depart_time and $key != depart_date and $key != arrival_time and $key != return_date and $key != return_depart and $key != return_arrive and $key != price and $key != other and $key != contact and $key != condition and $key != color and $key != date_available and $key != distance and $key != pets and $key != deposit and $key != lease and $key != mileage and $key != dates_available) if ( $value == ) echo font face=verdana size=1 color=redRequired information is missing.\n Please click your browser's back button, try again./fontbr\n; exit(); if (ereg(^[A-Za-z' -]{1,50}$,$key)) echo font face=verdana size=1 color=redSome information is not processing.\n Please click your browser's back button, check you entries and try again./fontbr\n; exit(); $$key = strip_tags(trim($value)); /*this next section checks the contact field to see if it is an irregular phone or email address. i would prefer to have two seperate fields(phone,email) to be checked individually but only one or the other is required and i don't know how to have it check; if one field is filled in and if it contains no irregularities, it is ok if the other field is not filled in. then, on to else.*/ if (ereg(^[0-9)(xX -]{7,20}$,$contact)) echo font face=verdana size=1 color=redIt appears your Contact Phone Number may be entered incorrectly.\n Please click your browser's back button, check your entry and try again./fontbr\n; exit(); if (!ereg(^.+@.+\\..+$,$contact)) { echo font face=verdana size=1 color=redIt appears your eMail Address may be entered incorrectly.\n Please click your browser's back button, check your entry and try again./fontbr\n; exit(); } else foreach($HTTP_POST_VARS as $column_name = $column_value) $column_names .= $column_name . ','; $column_values .= '$column_values',; $today = date(-mm-dd); $query = insert into ads values ($column_names,createdate) values ($column_values,'$today'); $result = mysql_db_query($dbname,$query) or die (mysql_error()); /* send email to account holder */ $emess1=\n\n\tUsername:$email\n\n; $emess2=A new Vanderbilt Register Classified Ad has been setup for you.; $emess3=We appreciate your Placing an ad with us.\n\n; $emess4=If you have any questions or problems, email ; $emess5=[EMAIL PROTECTED]; $emess = $emess1.$emess2.$emess3.$emess4.$emess5; $ehead=From: [EMAIL PROTECTED]\r\n; $subject = Your Vanderbilt Register Classified Ad; $mailsend=mail($email,$subject,$emess,$ehead); $body = A new ad has been added to the que. You may add the store to the site by going to http://www.vanderbilt.edu/ca/admin/index.php ; mail([EMAIL PROTECTED], New Ad, $body); ? -- Addison Ellis small independent publishing co. 114 B 29th Avenue North Nashville,
RE: [PHP-DB] save output to a file instead of displaying in the browser
It turns out to be quite simple. Just play with the PHP header() function header(Content-Type: $application/$Format); header(Content-Disposition: attachment; filename=$file_name); --- Boaz Yahav [EMAIL PROTECTED] wrote: This looks like a great example to add to weberdev. If you get the answer, would you care to spend 3 minutes and let other PHP developers enjoy from your knowledge? You are one click away from doing a good deed :) http://www.weberdev.com/index.php3?GoTo=addexample.php3 Sincerely berber Visit http://www.weberdev.com Today!!! To see where PHP might take you tomorrow. -Original Message- From: Qunfeng Dong [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 23, 2003 3:32 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] save output to a file instead of displaying in the browser Hi, I am trying to build a PHP-MySQL application. When users query our database from our web interface, how can I send the output to a file for users to save it to his local disk instead of displaying the output to the browser. Thanks, Qunfeng __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Question on the port PHP uses to connect to remote MySQL
Here is my problem. I have PHP running on one machine, mysql on another one. Everything works fine till I put a firewall on the PHP machine, which blocks pretty much every port there is except port 80. Now, PHP can't connect to the mysql database anymore. If I disable the firewall on the PHP machine it works again. So I eliminate the reasons down to that PHP must uses some port for mysql return the query. The question is which port does PHP use for the connection? I'm NOT talking about 3306 which is used by Mysql. Anyone could help? Thanks in advance. Louis -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] really stumped!
On Wednesday 29 January 2003 09:50, Addison Ellis wrote: hello and thank you for taking a look at this. i, no matter what id do can not get variables to echo a value or inserted into my db. i uploaded the original file and parse error line by parse error line had to remove all brackets, which doesn't make sense to me right now, except for the two encompassing header:. one of many forms submitted to this will actually process and post now with no errors but will not, as i mentioned, print any of my echo. here is the thing in it's entirety and i very much appreciate your time and efforts. best regards, addison ellis I see that for the past week or so you've been struggling with this and (to me) don't seem to be making much progress. If all this is a learning exercise then good luck to you. If your main objective is to get something up and running then try using someone else's code. There are plenty of classes at www.phpclasses.org which builds and verifies forms for you. Also searching freshmeat.net for mysql forms should be rewarding. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* I have a very small mind and must live with it. -- E. Dijkstra */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Question on the port PHP uses to connect to remote MySQL
On Wednesday 29 January 2003 11:34, Louis Feng wrote: Here is my problem. I have PHP running on one machine, mysql on another one. Everything works fine till I put a firewall on the PHP machine, which blocks pretty much every port there is except port 80. Now, PHP can't connect to the mysql database anymore. If I disable the firewall on the PHP machine it works again. So I eliminate the reasons down to that PHP must uses some port for mysql return the query. The question is which port does PHP use for the connection? Most likely it varies. Your firewall should have stateful inspection so that whatever port was used to initiate the connection with mysql should be allowed through. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* We're all in this alone. -- Lily Tomlin */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Help/Advice/Suggestions need to Upload 9 images on one submit button.
On Tue, Jan 28, 2003 at 10:44:47PM +0100, Geckodeep wrote: Hi Rajesh First of all I'd like to thank you for your time. No hassles. I got the script working in a way that it feeds my DB table, but I am getting this error message: Warning: copy() [function.copy]: Unable to access in upload1.php on line 28. this is what I have in the 28th line : if(!copy($_FILES['img_name1']['tmp_name'], ./repor_images/$_FILES['img_name1']['tmp_name'])):; I have never come across the above error message. It looks like copy function is not allowed on the webserver. for the moment I am trying it with one field and I am waiting to see if it's working, and I'll had the rest with the Captions to go with the images. One thing I've forgot to say is though in my database instead of just having the name of the image copied from the source (Form Field) I have the whole path in the field ( /var/www/12/1/7/-/site/www/php1PWwsF ), is it normal or what?. In my application, I am uploading the file and than creating a thumbnail from it and storing both image as well as thumbnail in mysql blob field. if (!is_uploaded_file($_FILES['Imagefile1']['tmp_name'])) { $sErrorStr .= Error Uploading File: '$Imagefile1'. . Either the File Type is Invalid or some connectivity problem, Check out ; } else { $imgtype = $_FILES['Imagefile1']['type']; copy($_FILES['Imagefile1']['tmp_name'], './tmp/downloadedfile1.jpg'); $filename = './tmp/downloadedfile1.jpg'; create_thumbnail($filename, $imgtype, $escaped_image, $escaped_thumbnail); } I've looked up in the PhpManual for copy() and it says it takes two arguments, in that case if I did put it in this way will it work copy($img_name1,/repor_images/$id.$img_name1); // $img_name1 as the source and repor_images/$id.$img_name1 as the destination, Should work. I also have few questions. Does that mean I have to have 9 copy functions as above, and just change the img_nameX?. Yes. Do I have to mention File size and file type for all the file Fields in the form or will it be ok just to mention once just above the submit button?. I feel it is required for all the fields. More experienced souls on the list, please comment. Peace -- Rajesh : [ GNU/Linux One Stanza Tip (LOST) ]### Sub : Spell check within MuttLOST #157 If you have the ispell package (interactive spelling checker) installed, and maybe your preferred dictionary file iamerican, ibritish (whatever), press i after finishing composition and prior to sending mail (under mutt) ... [EMAIL PROTECTED]### : -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Help with converting data type from Database in PHP
I think I remember something about pack and unpack working with aunti endian, uncle endian and all the little endians. Jason -Original Message- From: Robert Trembath [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 28, 2003 9:02 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP-DB] Help with converting data type from Database in PHP Has anyone done 16-bit integer conversion to decimal in PHP or know the formula to convert the data. Below is an example of what oracle gives me and what I need to convert it to. Any help would be greatly appreciated. Thanks, Robert I get this in unsigned 16-bit Integer format: AACBAACBAACDAACIAADEAAEFAAENAAELAAEMAAEMAAEPAAFDAAENAAFGA AFGAAELAAFFAAFMAAFAAAECAAENAAFMAAGBAAFBAADHAADGAAEEAAFCAA GCAAGJAAFMAADLAACMAACKAACLAACPAADIAAEHAAFHAAGGAAGPAAGIAAEL AACPAACKAACIAACIAACJAACKAACJAACKAACJAACLAACLAACOAADGAAEFAAF GAAGHAAHEAAHFAAGBAADKAACLAACKAACKAACKAACKAACJAACKAACLAACK AACJAACJAACKAACJAACJAACIAACJAACKAACKAACJAACKAACJAACKAACLAACL AACLAACKAACLAACMAACNAACPAADHAAEHAAFOAAHCAAHOAAHIAAFBAADBAA CNAACNAACMAACMAACMAACMAACMAACLAACLAACMAACMAACNAACMAACMA ACNAADAAADCAADNAAFBAAGKAAIBAAIMAAHMAAEIAADAAACOAACMAACMAAC LAACKAACJAACKAACJAACJAACJAACIAACIAACIAACIAACHAACIAACHAACHAACHA ACHAACHAACGAACGAACHAACHAACGAACGAACGAACHAACGAACFAACFAACGAAC FAACFAACFAACGAACGAACFAACFAACFAACGAACFAACGAACGAACFAACFAACGAA CHAACHAACHAACHAACKAADFAAEKAAGFAAHEAAGIAADLAACJAACHAACHAACFAA CFAACFAACFAACFAACFAACFAACFAACFAACFAACFAACEAACFAACFAACFAACEAA CFAACFAACGAACEAACFAACFAACFAACGAACFAACEAACFAACFAACGAACFAACEAA CFAACEAACFAACFAACFAACGAACGAACFAACFAACFAACFAACFAACGAACGAACGAA CGAACFAACFAACGAACGAACGAACGAACHAACHAACGAACHAACHAACGAACGAACGA ACFAACFAACFAACGAACFAACGAACGAACGAACFAACFAACGAACHAACGAACGAACGA ACGAACGAACJAADAAADOAAFAAAFLAAFPAAFHAAECAACPAACHAACGAACFAACFAA CFAACFAACEAACFAACEAACEAACEAACFAACFAACFAACFAACEAACFAACEAACDAACE AACGAACKAADCAADLAAEAAADIAACMAACHAACEAACDAACEAACDAACDAACDAACD AACEAACHAACMAADDAADJAADHAACPAACHAACDAACBAACBAACBAACCAACBAACB AACCAACDAACFAACLAADAAADDAACPAACIAACDAACCAACBAACAAACAAABPAABPA ACAAABPAABPAABOAACAAABPAABOAABOAABOAABOAABMAABNAABNAABNAABMA ABNAACAAACCAACEAACEAACDAACAAABNAABLAABMAABMAACAAACBAACBAACAA ABNAABLAABLAABKAABKAABJAABJAABKAABJAABKAABKAABKAABKAABLAABMAAB OAABPAACAAACBAABOAABNAABMAABLAABLAABMAABMAABNAABNAABNAABMAAB LAABKAABKAABJAABIAABIAABIAABIAABHAABIAABIAABHAABIAABHAABHAABHAABHA ABGAABHAABGAABGAABHAABGAABGAABHAABHAABHAABGAABGAABGAABFAABFAABF AABFAABEAABDAABDAABDAABDAABDAABDAABCAABCAABCAABCAABCAABCAABBAA BBAABBAABAAABBAABAAABAAABAAABAAABPAABPAAAPAAAOAAAOAAAO AAANAAANAAANAAANAAAMAAAMAAAMAAALAAALAAAKAAAKAAAKAAAKAAAJAAAIAAA This is the same data converted to decimal, which is what I need PHP to do: 0,0,43,44,45,45,45,46,47,48,48,49,50,51,53,55,54,54,54,54,55,55,55,56,56,58, 66,77,89,96,89,75,70,74,84, 92,87,81,79,74,68,66,65,65,66,72,80,86,81,78,86,96,97,92,91,83,73,67,65,63,6 2,62,62,63,64,63,64,70,81, 89,86,76,67,62,59,59,61,60,59,60,63,65,70,74,68,60,59,59,58,57,57,57,57,60,6 1,59,58,58,59,65,68,64,62, 65,74,88,97,94,95,103,90,68,58,58,59,62,71,86,97,87,68,68,75,70,59,54,54,53, 53,52,51,51,52,51,50,50,49, 48,48,47,47,47,47,47,47,47,47,47,47,46,46,46,45,45,45,45,45,46,47,48,48,45,4 4,44,45,46,47,46,45,44,45, 45,45,45,44,44,45,46,49,52,50,47,45,45,45,45,45,45,46,46,50,56,55,48,45,44,4 4,43,44,45,48,52,53,50,48, 47,45,45,44,44,44,45,44,44,45,45,46,47,51,60,73,81,70,52,46,46,46,46,46,46,4 6,46,45,46,47,47,47,48,50, 57,75,105,143,167,157,119,90,78,63,50,45,45,45,44,43,43,44,43,42,42,42,42,42 ,42,43,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,41,41,42,43,43,45,46,47,47,47,53,68,99,140,171,16 1,110,62,45,42,41,40,40, 40,39,38,38,38,38,37,36,37,37,37,37,37,37,37,37,37,38,38,36,36,36,36,35,35,3 4,34,34,34,33,33,33,34,34, 34,33,33,33,33,33,32,32,32,32,32,31,31,31,31,30,30,29,28,28,29,28,28,28,28,2 8,27,27,27,27,27,27,26,26, 26,27,27,27,26,26,26,27,27,27,27,27,28,28,28,27,27,27,28,27,27,27,27,28,28,2 7,27,27,27,27,27,27,27,26, 26,26,25,25,25,25,25,25,24,24,25,24,24,24,24,24,24,23,23,23,23,23,23,22,22,2 2,22,22,22,21,21,21,21,20, 20,20,20,20,19,19,19,19,19,18,18,18,17,17,17,17,18,18,18,17,17,16,16,16,15,1 5,15,14,14,13,13,13,12,12, 12,11,11,10,10,10,0, -- 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] PHP and Sybase
Hello, I would like to make a connection to a sybase database in PHP. I installed freetds version 0.60 and it work fine (i can connect to a sybase database). Then, i compile the sybase extension (with php-devel) : $ phpize $ ./configure --with-php-configure=/usr/bin/php-config --with-sybas=/usr/local/freetds $ make $ make install I get the library php_sybase_db.so. I had a line in the php.ini file and i restart apache ($ apachectl restart) But when apache restart, i get an error: httpd : error while loading shared libraries :usr/lib/php/extensions/php_syabse_db.so undefined symbol : dbinit. I found this in the comments on sybase : If you compile php with freetds (www.freetds.org http://www.freetds.org) support (--with-sybase in php), apache might NOT START due to unresolved symbol. This can be easily solved by adding -ltds flag in config_vars.mk file after configuring PHP under the line EXTRA_LIBS. You can view this debug fix on www.freetds.org http://www.freetds.org under FAQ section. But i don't know where to add the option -ltds in config_vars.mk file. Could you help me Thank by advance. Raphael KISTER -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php