Re: [PHP-DB] Automatically Refreshing png-Image'd Web Page
You might want to use iframe's so you can refresh just individual sections when you need to. On Fri, 2004-03-19 at 12:00, [EMAIL PROTECTED] wrote: Howdy Listers, The Background: I am making dynamic, color-coded, png images of the floor plan of a building and displaying them in a browser. Numerous radioactivity sensors throughout the building send their readings to a MySQL dB, and the web page queries the dB, and depending on the readings, the areas specific to the sensors will appear green for normal, yellow for high but acceptable, and red for critical. All this works OK. The Problem: Neither the HTML nor JavaScript code I usually use for automatically refreshing a page has any effect if the header(Content-type: image/png) necessary for displaying the png image is included. If I comment out the header() line, the page refreshes, but the image data comes through as hieroglyphics. Obviously, I need to refresh the page to get the latest data, and to create and display the corresponding image. The Question: Is there any way to automatically refresh a web page displaying a png image? Thanks in advance for any thoughts/insights into how I can solve this problem. dave -- Adam Voigt [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQL - separating web and database servers
I don't understand, your ready to hack the MySQL extension, rather then just use one of the free text editors, that let you mass replace all your pages at once (which takes roughly 10 seconds)? On Thu, 2004-03-18 at 10:15, Operator wrote: Probably I need to change this behaviour in ext/mysql/libmysql/libmysql.c for my installation, but this is my last hope (mostly because I'm not a C programist...) If some of you could tell me if it's possible without breaking something else, or point me to the lines that do the job... I suppose the change needed would be quite simple. PB -- Adam Voigt [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP - MSSQL - LINUX
No, if you are attempting to run PHP under Windows, you want the MSSQL DLL File, if you are attempting to run PHP under Linux or Unix, you want to install FreeTDS from www.freetds.org On Wed, 2004-03-17 at 05:17, Santhosh Kumar wrote: Hi Madhu, I am speaking about MSSQL not MySQL . Is it possible can i get for MSSQL.so from MYSQL Installation. Thanks and Regards, Santhosh Kumar.M - Original Message - From: Madhu Manjari To: [EMAIL PROTECTED] Sent: Wednesday, March 17, 2004 2:27 PM Subject: Re: [PHP-DB] PHP - MSSQL - LINUX Hi Santosh Try to install mysql-3..22 source where you will get all libraries by default . After installation of mysql configure php support with mysql. Madhu. Hi All, Where do I get mssql.so to connect mssql with my PHP4.0.6 and PHP4.3.3 Regards, Santos Kumar.M -- This Message and any attachments is intended solely for the addresses and is confidential. If you receive this message in error or if you are not the intended recipient, please delete the mail. Any use not in accord with its purpose, any dissemination or disclosure, either whole or partial, is prohibited. Please inform us in case of erroneous delivery, thanks for your cooperation. -- Adam Voigt [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySql query
Yes, where evaluates to true. On Wed, 2004-03-17 at 12:03, Matt Matijevich wrote: This is probably a question for for a mysql list but I figured someone out here knows the answer. I am working with an existing mysql application and there is a bunch of queries that are formatted something like this: SELECT * FROM sometable WHERE 1 does WHERE 1 just return every row? thanks in advance. -- Adam Voigt [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] mssql query
SELECT count(id) FROM users WHERE DATEDIFF(eventtime,GETDATE(),d) == 1; Or something along those lines, all the date functions are very well documented in the digital books that come with Enterprise Manager. Open up the reference, and search for datediff, and there should be a link in there for the date functions as a whole. On Tue, 2004-03-16 at 10:32, Adam Williams wrote: I've used mysql a little, but now I'm working with a MS SQL SERVER 2000 database. We have a proprietary application/hardware setup where when a person enters the building, the time they enter the building is automatically put into the database in a field called eventtime, and their access card is entered in a field called cardnum. The time entered is like the mysql NOW() function (i dunno what its called in mssql), the format is -MM-DD HH:MM:SS.000 anyway. I need to write an SQL query that will get a unique count of cardnum based on how many times the person enters a building each day. So I need to do some sort of UNIQUE (although in mssql I think its distinct) count on the -MM-DD and ignore the HH:MM:SS.000, but looking at the mssql reference book I have, it doesn't go into great detail on date functions, so I was wondering if anyone knows how to do a unique on the eventtime with the date and ignore the time. -- Adam Voigt [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] PHP - MSSQL connects, but can't query
Yes, I'm connecting to a MSSQL server from FreeTDS, and it works fine. Try using the IP of the MSSQL server instead of the name, and see if that makes any difference. On Mon, 2004-03-15 at 09:23, Jason Morrill wrote: I changed the mssql_select_db line as suggested by another person here but it didn't change a thing. I still get the exact same error message. Is there anyone else here connecting to a MS SQL server using TDS v8.0 ?? Thanks! Jason -Original Message- From: Jason Morrill [mailto:[EMAIL PROTECTED] Sent: Friday, March 12, 2004 8:36 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] PHP - MSSQL connects, but can't query I've got a very simple PHP script for testing my MS SQL Server connection. I've installed FreeTDS and I can connect and query the database with TSQL. With PHP I can connect and disconnect properly but I can't query or attach to different databases. Here is my sample PHP followed by what the web server throws back at me: sql-test.php html body bgcolor=white ?php $dbproc = mssql_connect(roger,sa,admin); #$dbproc = sybase_connect(roger,sa,admin); if (! $dbproc) { print Can't connect to server; return; } print Connected to server.; $dbconnect = mssql_select_db(Northwind); if (! $dbconnect) { print Can't connect to Northwind; return; } print Connected to database; #$res = sybase_query(select * from test,$dbproc); #if (! $res) { # return; #} #while ($arr = sybase_fetch_array($res)) { # print $arr[i] . . $arr[v] . br\n; #} if (! mssql_close($dbproc)) { print Can't close server connection; return; } print Connection closed.; ? /body /html Output in browser when referencing the sql-test.php file: - Connected to server. Warning: Sybase: Server message: Line 1: Incorrect syntax near 'e'. (severity 15, procedure N/A) in /home/www/sql-test.php on line 12 Can't connect to Northwind Can anyone help me figure this one out?! Thanks! Jason Morrill IT Manager Child Family Agency SE Connecticut -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP - MSSQL connects, but can't query
Hmm, replace the line where you select the DB with: $dbconnect = mssql_select_db(Northwind) or die(mssql_get_last_message()); (All on one line incase the email wraps it.) On Fri, 2004-03-12 at 08:35, Jason Morrill wrote: I've got a very simple PHP script for testing my MS SQL Server connection. I've installed FreeTDS and I can connect and query the database with TSQL. With PHP I can connect and disconnect properly but I can't query or attach to different databases. Here is my sample PHP followed by what the web server throws back at me: sql-test.php html body bgcolor=white ?php $dbproc = mssql_connect(roger,sa,admin); #$dbproc = sybase_connect(roger,sa,admin); if (! $dbproc) { print Can't connect to server; return; } print Connected to server.; $dbconnect = mssql_select_db(Northwind); if (! $dbconnect) { print Can't connect to Northwind; return; } print Connected to database; #$res = sybase_query(select * from test,$dbproc); #if (! $res) { # return; #} #while ($arr = sybase_fetch_array($res)) { # print $arr[i] . . $arr[v] . br\n; #} if (! mssql_close($dbproc)) { print Can't close server connection; return; } print Connection closed.; ? /body /html Output in browser when referencing the sql-test.php file: - Connected to server. Warning: Sybase: Server message: Line 1: Incorrect syntax near 'e'. (severity 15, procedure N/A) in /home/www/sql-test.php on line 12 Can't connect to Northwind Can anyone help me figure this one out?! Thanks! Jason Morrill IT Manager Child Family Agency SE Connecticut -- Adam Voigt [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Protecting mysql database
Why not just stop the database? On Wed, 2004-03-03 at 09:41, Piet from South Africa wrote: Hi Is there a way that an alert or something can be generated when a mysql database is being accessed in any way. I want to close the whole database for a period, and nobody may access the database via phpadmin or anything else Appreciate your input on this one. -- Adam Voigt [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Uploading files
Your max post size needs to be upped to, try making it 6M and see if that makes a difference. On Fri, 2004-02-27 at 10:05, nikos wrote: Hello list Allthough I set my PHP.in upload_max_file=4M my system refused to upload files bigger than 1M and the browser send an server not found error. Does anybody know anything about that? Thank you -- Adam Voigt [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Uploading files
If your on a slow connection, it might be timing out. Try putting: set_time_limit(0); At the top of the page where the file is being uploaded to (not from), and see if that helps. On Fri, 2004-02-27 at 10:29, nikos wrote: It is allready 8M - Original Message - From: Adam Voigt [EMAIL PROTECTED] To: nikos [EMAIL PROTECTED] Cc: PHP-mailist [EMAIL PROTECTED] Sent: Friday, February 27, 2004 5:13 PM Subject: Re: [PHP-DB] Uploading files Your max post size needs to be upped to, try making it 6M and see if that makes a difference. On Fri, 2004-02-27 at 10:05, nikos wrote: Hello list Allthough I set my PHP.in upload_max_file=4M my system refused to upload files bigger than 1M and the browser send an server not found error. Does anybody know anything about that? Thank you -- Adam Voigt [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Connect to MSDE using PHP
I have connected to MSDE from PHP and it does work, what I would suggest, is ignore trying to do hostnames, and use IP's, so change the connect line to the IP of the MSDE machine. I know some will say it's not necessary, but I'm just telling you what I did, and it worked fine using the standard mssql functions, not odbc. On Sun, 2004-02-22 at 10:57, John W. Holmes wrote: I've downlownded and installed the Desktop Edition of MSSQL and am trying to connect to it with PHP. Has anyone ever accomplished this? I've uncommented the line in php.ini to load the MSSQL functions and they show up on a phpinfo() page, so that part is good. When I installed MSDE I tried it without a named instance first and just set an SA password. Neither of these worked: mssql_connect('localhost','sa','password') mssql_connect('coconut','sa','password') where coconut is the name of my computer. Then I tried installing MSDE again with a named instance and tried mssql_connect('namedinstance\localhost','sa','password') mssql_connect('namedinstance\coconut','sa','password') and those wouldn't work either. The only response I get is failed to connect to server ... I'm off to try ODBC. Anyone have any suggestions? -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com -- Adam Voigt [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Embedded MySQL server (libmysqld)?
Check these guys out: http://spenix.com/WebHostingPlans.aspx Very cheap, very reliable, great features, and support is second to none I've ever experienced, and before you ask, no I'm not now nor have I ever been an employee or shareholder. =) Just a satisfied customer. On Mon, 2004-02-23 at 09:53, [EMAIL PROTECTED] wrote: Howdy -- Would someone point or provide me with an example of PHP + libMysqld (Embedded MySQL server)? My problem is my churchs web site doesn't provide a MySQL database as a default package (add $15.95/mo)for a MySQL Db. TIA, David -- Adam Voigt [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: [PHP] Re: [PHP-DB] Embedded MySQL server (libmysqld)?
Alright, well with any txt based system, your probably going to run into problems with multi-users (multiple browsers) updating the DB. Reguardless, if you must use txtbased, I recommend SQL-Lite, it supports SQL statements, and is very small and very fast. http://www.sqlite.com On Mon, 2004-02-23 at 11:53, [EMAIL PROTECTED] wrote: Adam Voigt wrote: Check these guys out: http://spenix.com/WebHostingPlans.aspx Very cheap, very reliable, great features, and support is second to none I've ever experienced, and before you ask, no I'm not now nor have I ever been an employee or shareholder. =) Just a satisfied customer. Admin -- There is no shortage of good cheap hosting package. The choice of hosting providers is out of my hands. What I'm looking for is a way to implement a relational database in docuument_root of the web site (ie. /home/username)? David -- Adam Voigt [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] MS SQL 'Changed database context' error
Well, even though ignoring the error's (which is actually just an informational message), you could call the error_reporting function right above the line throwing the message, and then again below that line, turning error_reporting back to the default level. On Thu, 2004-02-19 at 16:38, Michael Flanagan wrote: Adam, Thanks for the suggestions. I don't want to ignore all error handling. Later, I might get an error that I really don't want php to swallow due to either of your suggestions. Has anyone else run into this and solved it? Any idea why the following lines in the php.ini file don't work? mssql.min_error_severity = 11 mssql.min_message_severity = 11 Michael -Original Message- From: Adam Voigt [mailto:[EMAIL PROTECTED] Sent: Thursday, February 19, 2004 12:44 PM To: Michael Flanagan Cc: [EMAIL PROTECTED] Subject: RE: [PHP-DB] MS SQL 'Changed database context' error Try putting the error suppressor (@) before the query, eg: @mssql_query Or, try setting the error reporting: error_reporting(0); On Thu, 2004-02-19 at 14:38, Michael Flanagan wrote: Thanks, Adam. I don't get the error in Enterprise manager. MS has a KB article out that says that this message is informational. I seem to remember that the article also says the message comes out some times, and not other times, but that you should just forget it. The particular SELECT statement I'm getting the message on is the second query in my script. The other query is to the same db; in fact, it uses the exact same $db connection object. Any ideas on getting PHP to ignore this info message? Thanks again. Michael -Original Message- From: Adam Voigt [mailto:[EMAIL PROTECTED] Sent: Thursday, February 19, 2004 12:13 PM To: Michael Flanagan Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] MS SQL 'Changed database context' error This may not be the case, but I've seen this before when the PHP library didn't know how to express MS SQL's error, so it simply returns the last message sent which was the informational context change. If it is infact an error, you should be able to plug the query directly into Enterprise Manager to see MS SQL's take on the problem, so to speak. =) But again, this is all just in my past experience's, yours may differ greatly. On Thu, 2004-02-19 at 14:08, Michael Flanagan wrote: I'm getting the error Changed database context from MS SQL. I see where this is supposedly just an informational message. I've tried setting mssql.min_error_severity = 11 mssql.min_message_severity = 11 but to no avail. What am I missing? I don't mind the message so much, but php treats this as an error, and doesn't execute my query. I'm running php 4.3.3 for Windows; the SQL Server and web server are on the same machine. I'm using PEAR:DB for the database access. Thanks. Michael Flanagan voice: (1) 303-674-2691 fax: (1) 603-963-0704 (note '603' area code) mailto:[EMAIL PROTECTED] -- Adam Voigt [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MS SQL 'Changed database context' error
This may not be the case, but I've seen this before when the PHP library didn't know how to express MS SQL's error, so it simply returns the last message sent which was the informational context change. If it is infact an error, you should be able to plug the query directly into Enterprise Manager to see MS SQL's take on the problem, so to speak. =) But again, this is all just in my past experience's, yours may differ greatly. On Thu, 2004-02-19 at 14:08, Michael Flanagan wrote: I'm getting the error Changed database context from MS SQL. I see where this is supposedly just an informational message. I've tried setting mssql.min_error_severity = 11 mssql.min_message_severity = 11 but to no avail. What am I missing? I don't mind the message so much, but php treats this as an error, and doesn't execute my query. I'm running php 4.3.3 for Windows; the SQL Server and web server are on the same machine. I'm using PEAR:DB for the database access. Thanks. Michael Flanagan voice: (1) 303-674-2691 fax: (1) 603-963-0704 (note '603' area code) mailto:[EMAIL PROTECTED] -- Adam Voigt [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] MS SQL 'Changed database context' error
Try putting the error suppressor (@) before the query, eg: @mssql_query Or, try setting the error reporting: error_reporting(0); On Thu, 2004-02-19 at 14:38, Michael Flanagan wrote: Thanks, Adam. I don't get the error in Enterprise manager. MS has a KB article out that says that this message is informational. I seem to remember that the article also says the message comes out some times, and not other times, but that you should just forget it. The particular SELECT statement I'm getting the message on is the second query in my script. The other query is to the same db; in fact, it uses the exact same $db connection object. Any ideas on getting PHP to ignore this info message? Thanks again. Michael -Original Message- From: Adam Voigt [mailto:[EMAIL PROTECTED] Sent: Thursday, February 19, 2004 12:13 PM To: Michael Flanagan Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] MS SQL 'Changed database context' error This may not be the case, but I've seen this before when the PHP library didn't know how to express MS SQL's error, so it simply returns the last message sent which was the informational context change. If it is infact an error, you should be able to plug the query directly into Enterprise Manager to see MS SQL's take on the problem, so to speak. =) But again, this is all just in my past experience's, yours may differ greatly. On Thu, 2004-02-19 at 14:08, Michael Flanagan wrote: I'm getting the error Changed database context from MS SQL. I see where this is supposedly just an informational message. I've tried setting mssql.min_error_severity = 11 mssql.min_message_severity = 11 but to no avail. What am I missing? I don't mind the message so much, but php treats this as an error, and doesn't execute my query. I'm running php 4.3.3 for Windows; the SQL Server and web server are on the same machine. I'm using PEAR:DB for the database access. Thanks. Michael Flanagan voice: (1) 303-674-2691 fax: (1) 603-963-0704 (note '603' area code) mailto:[EMAIL PROTECTED] -- Adam Voigt [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: How to get PHP to download web contents
Try CURL: http://us2.php.net/curl On Mon, 2003-07-07 at 10:17, Steve B. wrote: Yes I had tried all those below before posting. It sounds like this is the only way to deal with authentication from what I see. In windows it works fine from the browser to include name and pass in url. In Linux it comes back and asks for the pw again. I'd think the only difference would be in headers. Is there any header info todo with authentication which come from the client which are not set by doing the url name and pw? Thanks, Steve --- Ognyan Bankov [EMAIL PROTECTED] wrote: Steve B. [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi Nadim, It works but not for sites with password window that pops up. I see. That is HTTP Basic Authentication You should use this line: $filename = 'http://someuser:[EMAIL PROTECTED]/'; instead of: $filename = http://somesite.com?user=someuserpwd=somepwd; and source will look like: ?php // get contents of a file into a string $filename = 'http://someuser:[EMAIL PROTECTED]/'; $handle = fopen ($filename, r); $contents = fread ($handle, filesize ($filename)); fclose ($handle); ? nadim's solution will look like this: $html = implode ('', file ('http://someuser:[EMAIL PROTECTED]/')); -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com -- Adam Voigt ([EMAIL PROTECTED]) Linux/Unix Network Administrator The Cryptocomm Group -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Reading from a file
$data = file('c:\file.txt'); for($counter = 0; $counter count($data); $counter++) $data[$counter] = explode(\t,$data[$counter]); Poof. For: bob ninajim joe You will get: $data[0][0] = 'bob'; $data[0][1] = 'nina'; $data[0][2] = 'jim'; $data[0][3] = 'joe'; Nice and easy to recurse through. On Tue, 2003-07-01 at 12:10, Rick Dahl wrote: I need to read from a file that is tab delimited. Is there anyway to specify that it reads between each tab and that is it. I know fread() uses bytes to figure out what to read but that isn't very practical in my case. Also, how do I get rid of any white space at the end of a variable if there is some once it is read in? - Rick -- Adam Voigt ([EMAIL PROTECTED]) Linux/Unix Network Administrator The Cryptocomm Group -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] moving though an array..
One Thing: Change $columns[] to $colums, example: $columns = explode(',',$threadsColumn); On Thu, 2003-06-26 at 10:23, Aaron Wolski wrote: Hi All, Hopefully someone here can point me in the right direction. I need to create a SELECT statement based on some criteria select and entered into a form. Form variables: $threadsColumn = manufactuer,colour; $string = n; Code: $columns[] = explode(,,$threadsColumn); $test = (; for ($i=0;$isizeof($columns);$i++) { $test .= $columns[$i]. %$string%; } $test .= ); echo $test; What I am attempting to do is create a select statement that would look like (based on form variables): SELECT * FROM tablename WHERE (manufacturer LIKE %n% OR colour LIKE %n%) The information between ( and ) needs to be written in such a manner that it scales up or down in options.. depending on what was selected in the form. ANYONE have some thoughts? Oh.. when I echo the above code I get this: (Array %h%) Thanks! Aaron -- Adam Voigt ([EMAIL PROTECTED]) Linux/Unix Network Administrator The Cryptocomm Group -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Related Tables - Capture ID
Do the second query, call the mysql_insert_id function, and that will give you the id of the row it just inserted. On Thu, 2003-06-26 at 11:43, Marie Osypian wrote: Hello, I have three table in which I am inserting records into in one script. I need to capture the ID of the second tables record insertion to insert into a field into a related table in the third. What would the easiest way to go about this in php? Thanks, MAO -- Adam Voigt ([EMAIL PROTECTED]) Linux/Unix Network Administrator The Cryptocomm Group -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Accessing MySql using Flash while using PHP as themiddleware
Might want to check out a article on devshed: http://devshed.com/Client_Side/Flash/DataDrivenFlash/page1.html On Wed, 2003-06-25 at 11:15, Ron Allen wrote: Does anybody have an idea how-to use Flash and PHP to access a MySql database. I know how to use PHP and mysql with no problem to pull info, but with Flash I am struggling. -- Adam Voigt ([EMAIL PROTECTED]) Linux/Unix Network Administrator The Cryptocomm Group -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Problem with php/mysql and ISS on windows XPprofeesional
If your missing the dollar sign then add it, if your not, then set error_reporting in your php.ini to E_ALL ~E_NOTICE. On Mon, 2003-06-02 at 10:52, Cal Evans wrote: Sounds like you left off a $ when using a variable. I would take a look at line 158, find the variable name and make sure it's $name. Disabling the error will cause the message to go away but not fix the problem. humbly, =C= * Cal Evans * http://www.christianperformer.com * Stay plugged into your audience * The measure of a programmer is not the number of lines of code he writes but the number of lines he does not have to write. * - Original Message - From: Ahmed Abdelaliem [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 02, 2003 9:50 AM Subject: [PHP-DB] Problem with php/mysql and ISS on windows XP profeesional hi i use php and mysql on IIS server on windows xp professional when i select anything from the database i get this : Notice: Use of undefined constant name - assumed 'name' in d:\inetpub\wwwroot\EGYCDS\index.php on line 158 Spy Hunter while evrything is going fine when i upload it on the web and it returns only Spy Hunter i think i have to disable this eroor message only can any one tell me how i disable that error message _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) Linux/Unix Network Administrator The Cryptocomm Group -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Problem with php/mysql and ISS on windowsXPprofeesional
Ok, like I said, if it is an error (like a missing dollar sign) then put the dollar sign in, therefore fixing the problem. However, if there is not an error and he is simply using a variable and PHP is complaining it's not defined, that's not a big deal, thats why it doesn't make the code fail. It just means it noticed you accessed the variable $whatever without making sure it was defined before you checked if it was false, etc. No big deal, thats why the majority of PHP install's set the error_reporting to ignore E_NOTICE, because it's completely safe to do so. On Mon, 2003-06-02 at 10:58, Cal Evans wrote: Again, changing the error reporting level will not fix the problem. Since he is getting a warning AND his code is acting unexpectedly, he probably needs to concentrate on fixing the problem. (At least I assume that there is a problem. It sounds like there is from his description.) humbly, =C= * Cal Evans * http://www.christianperformer.com * Stay plugged into your audience * The measure of a programmer is not the number of lines of code he writes but the number of lines he does not have to write. * - Original Message - From: Adam Voigt [EMAIL PROTECTED] To: Ahmed Abdelaliem [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Monday, June 02, 2003 9:59 AM Subject: Re: [PHP-DB] Problem with php/mysql and ISS on windows XPprofeesional If your missing the dollar sign then add it, if your not, then set error_reporting in your php.ini to E_ALL ~E_NOTICE. On Mon, 2003-06-02 at 10:52, Cal Evans wrote: Sounds like you left off a $ when using a variable. I would take a look at line 158, find the variable name and make sure it's $name. Disabling the error will cause the message to go away but not fix the problem. humbly, =C= * Cal Evans * http://www.christianperformer.com * Stay plugged into your audience * The measure of a programmer is not the number of lines of code he writes but the number of lines he does not have to write. * - Original Message - From: Ahmed Abdelaliem [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 02, 2003 9:50 AM Subject: [PHP-DB] Problem with php/mysql and ISS on windows XP profeesional hi i use php and mysql on IIS server on windows xp professional when i select anything from the database i get this : Notice: Use of undefined constant name - assumed 'name' in d:\inetpub\wwwroot\EGYCDS\index.php on line 158 Spy Hunter while evrything is going fine when i upload it on the web and it returns only Spy Hunter i think i have to disable this eroor message only can any one tell me how i disable that error message _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) Linux/Unix Network Administrator The Cryptocomm Group -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) Linux/Unix Network Administrator The Cryptocomm Group -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Problem with php/mysql and ISS on windows XPprofeesional
Put single quote's around name in your record array, example: Use: $record['name'] Instead Of: $record[name] On Mon, 2003-06-02 at 11:04, Ahmed Abdelaliem wrote: here is the code i wrote i didn't miss the $ sign and it works fine on web but returns the error message when i use it on localhost ? @ $db = mysql_connect(localhost); mysql_select_db(cds); $test_tr = mysql_query(select name from newpcgames order by gameid desc LIMIT 0, 10); $test_tr1 = mysql_query(select name from newpcgames order by gameid desc LIMIT 10, 20); while($record = mysql_fetch_array($test_tr)) { $record1= mysql_fetch_array($test_tr1); echo TR bgColor=#475674 TD onmouseover=\this.bgColor='00'\ onmouseout=\this.bgColor='475674'\ bgColor=#475674 width=\50%\ DIV align=leftFONT color=#ff size=1strong; echo stripslashes($record[name]); echo /strong/tdtd /td; echo TD onmouseover=\this.bgColor='00'\ onmouseout=\this.bgColor='475674'\ bgColor=#475674 width=\50%\ DIV align=leftFONT color=#ff size=1strong; echo stripslashes($record1[name]); echo /strong/td /tr ; } ? From: Cal Evans [EMAIL PROTECTED] To: Ahmed Abdelaliem [EMAIL PROTECTED],[EMAIL PROTECTED] Subject: Re: [PHP-DB] Problem with php/mysql and ISS on windows XP profeesional Date: Mon, 2 Jun 2003 09:52:21 -0500 Sounds like you left off a $ when using a variable. I would take a look at line 158, find the variable name and make sure it's $name. Disabling the error will cause the message to go away but not fix the problem. humbly, =C= * Cal Evans * http://www.christianperformer.com * Stay plugged into your audience * The measure of a programmer is not the number of lines of code he writes but the number of lines he does not have to write. * - Original Message - From: Ahmed Abdelaliem [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 02, 2003 9:50 AM Subject: [PHP-DB] Problem with php/mysql and ISS on windows XP profeesional hi i use php and mysql on IIS server on windows xp professional when i select anything from the database i get this : Notice: Use of undefined constant name - assumed 'name' in d:\inetpub\wwwroot\EGYCDS\index.php on line 158 Spy Hunter while evrything is going fine when i upload it on the web and it returns only Spy Hunter i think i have to disable this eroor message only can any one tell me how i disable that error message _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail -- 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 _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail -- Adam Voigt ([EMAIL PROTECTED]) Linux/Unix Network Administrator The Cryptocomm Group -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Total Values with MySQL
SELECT SUM(ColumnName) AS total FROM table WHERE ColunName = '1'; On Mon, 2003-06-02 at 11:18, shaun wrote: Hi, Is it possible to get MySQL to total the values of a select statement, say 'SELECT ColumnName FROM Table WHERE ColumnName = '1'' Say I have three values in ColumnName all of '1' then can I get MySQL to return 3? Thanks for your help -- Adam Voigt ([EMAIL PROTECTED]) Linux/Unix Network Administrator The Cryptocomm Group -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Connect Microsoft SQL database with php on unix
You need to compile the FreeTDS library (freetds.org), and on your PHP configure line, add --with-sybase=/usr/local/freetds replacing the path for where you installed FreeTDS. And yes, it says Sybase, but no, you don't use the sybase functions, you can still use all the mssql_whatever functions. On Mon, 2003-03-31 at 13:40, Greg Cirino wrote: Maybe mssql_connect()?? www.php.net/mssql_connect The documentation indicates using sybase_connect (etc...) unless you are on a windows machine. But that doesn't work either as the sybase.so file seems to be non-existant (on my machine anyway) Regards Greg Cirino John W. Holmes [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I would like to know the best way to connect to SQL database(which located on Microsoft SQL Server) from PHP(Located on Unix Server). Maybe mssql_connect()?? www.php.net/mssql_connect ---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 -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Addslashes (MSSQL)
Umm, how about using str_replace to replace the quotes for there ASCII equivalent's, and when you print them out in HTML they will be interpreted properly, or you could str_replace them back. On Thu, 2003-03-20 at 11:23, Poon, Kelvin (Infomart) wrote: Actually, that eliminated the error messages but it still hasn't fix the problem I did what you saidbut now in my MSSQL table, the content column has somethign like thsi Step 1: blah blah balh Step 2: blah balh balh \'Username\' so it included the slashes...I just learned that mSSQL doens;t accept slashes so is there any other way I can fix this problem?..I want literally step 1: balh bah balh Step 2: balhb alhb alhb 'Username' to be inserted to the table..please help thanks a lot by the way -Original Message- From: CPT John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2003 11:06 AM To: Poon, Kelvin (Infomart); [EMAIL PROTECTED] Subject: Re: [PHP-DB] Addslashes (MSSQL) where my $content value is osmethign like this. Step 1: Access the homepage Step 2: type in your username under the field 'username' and after the addslashes funciton there would be \ around the 'username' like this.. \'username\'and now after running this program I got an error message: Warning: MS SQL message: Line 14: Incorrect syntax near 'username'. (severity 15) in d:\apache_docroots\internal.infomart.ca\infodesk\kb_add.php on line 119 I think you need to replace ' with '' in MSSQL (one single quote replaced with two single quotes) $text = str_replace(','',$old_text); ---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 -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc
Re: [PHP-DB] Help with MySQL Logic
Heh. Sounds like a programming class homework project. I would say through the clever use of where clauses's, like: UPDATE position SET posistion = (position-1) WHERE position $idremoved; Would work, assuming $idremoved containted the position of the car removed. On Mon, 2003-03-03 at 10:59, Rankin, Randy wrote: Hello All, This may be a bit off topic. If so, my apololgies. A client of mine, a rail car storage company, has asked that I create a PHP/MySQL application in which they will maintain and track rail cars. I am having a bit of trouble however working through one of thier requirements. They need to know in what position the rail car is on each track. For example, they might have a track called X which will hold 30 rail cars. They would enter the car information for 30 cars and associate each of them with track X. If one of the car owners decides to move car 3 out of storage, then the remaining 29 cars must be re-numbered ( ie; car 1 and 2 would remain and car 4-30 would become car 3-29 ). In the same manner, I need to be able to add a car to the track once an empty slot is available. For example, If the new car goes at the front of the track then it would become car 1 and the remaining cars, originally numbered 1-29 would become 2-30. I hope I explained thourougly. Any suggestions would be appreciated. Randy -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
Re: [PHP-DB] LIMIT problem MSSQL
Assuming your sorting by id, just do: SELECT TOP 50 * FROM TABLE WHERE id $lastid And just have lastid posting to the page every time they hit next, and in lastid, put the last id of the results on that page. On Wed, 2003-02-19 at 09:59, Noam Giladi wrote: I'm trying to split results into different pages and number the pages accordingly. I've been able to build a fairly intelligent page numbering system which knows which rows it should pull (at least by numbering each row numerically) but I don't know how to construct a SQL query to pull 10 results starting at a certain number. please did anyone wrote a proc that do it?. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
Re: [PHP-DB] LIMIT problem MSSQL
Well if you do, (sort by id) this will work. On Wed, 2003-02-19 at 11:14, Noam Giladi wrote: i'm not using a fixed sort tnx noam Adam Voigt [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Assuming your sorting by id, just do: SELECT TOP 50 * FROM TABLE WHERE id $lastid And just have lastid posting to the page every time they hit next, and in lastid, put the last id of the results on that page. On Wed, 2003-02-19 at 09:59, Noam Giladi wrote: I'm trying to split results into different pages and number the pages accordingly. I've been able to build a fairly intelligent page numbering system which knows which rows it should pull (at least by numbering each row numerically) but I don't know how to construct a SQL query to pull 10 results starting at a certain number. please did anyone wrote a proc that do it?. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
Re: [PHP-DB]
Very first result on google: http://www.oreillynet.com/cs/user/view/cs_msg/7231 Look at the first reply. (Next time go to google first.) On Wed, 2003-02-12 at 08:40, nikos wrote: Hi List! I'm trying to Drop a Table and aI get an error as follows: Error on delete of './horceng/oikology.MYI' (Errcode: 13) Does anybody know what is the error 13? Thanks Qbit - Gatsis Nikos Web developer tel.: 2108256721 - 2108256722 fax: 2108256712 email: [EMAIL PROTECTED] http://www.qbit.gr -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
RE: [PHP-DB] collaborating on a document
Riiight, anyway, since Adobe Acrobat is the worst possible answer for updating in real time (and completely wouldn't work), I would say, yes, two frames should work, but you might even want a third (hidden) at the bottom that never stops executing, just pulling entry's out when new ones are added, and use _javascript_ to add them to the right frames with the ideas. On Tue, 2003-02-11 at 10:16, Hutchins, Richard wrote: 1. This question has nothing to do with PHP or databases. 2. Adobe already thought of it: Adobe Acrobat 5.0. -Original Message- From: Baumgartner Jeffrey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 11, 2003 10:13 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] collaborating on a document I'm thinking about making a little tool where people can contribute ideas in real time. Thus far, the best way I can see to do this is via 2 frames Frame 1: for entering data - which is inserted into a table. Frame 2: would select from the table. It would also refresh frequently - say every 30 seconds. But perhaps you have a more elegant solution? Thanks, Jeffrey Baumgartner eBusiness Consultant - ITP Europe http://www.itp-europe.com [EMAIL PROTECTED] +32 2 721 51 00 -- 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 -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
RE: [PHP-DB] collaborating on a document
Ofcourse then everyone has to have Adobe installed, which is probably less likely then having _javascript_ enabled. On Tue, 2003-02-11 at 10:39, Hutchins, Richard wrote: Actually, Adobe 5.0 implemented on a server in Assembled or Integrated (their words, not mine) configuration DOES allow for real-time document collaboration. Whether this solution would actually solve the problem is determined by the requirements of the collaboration environment. If you're thinking Acrobat 4.0, you're absolutely right. Real-time collaboration is, for all practical purposes, non-existent. I'm not going to get into any further debate because it's off topic and all of the information is available on Adobe.com, specifically in the following links: http://www.adobe.com/products/acrobat/pdfs/acr05_review_wp.pdf and, more generally, http://www.adobe.com/acrofamily/collaboration.html. In regards to actually implementing a solution using JS, yes can work, but you're walking what can be a tight rope on client-side configuration. Some of the standard issues are: 1. You have to make sure your users all have JS enabled or your app won't work. 2. You'll have to write cross-browser compatible code back to v. 4.0 browsers as a standard. 3. Refreshing a screen every 30 seconds is going to really tick off users that don't have DSL or better connections. These issues are certainly not insurmountable. All of the above concerns can be alleviated, if not eliminated, if you're going to implement on an intranet where you have control over what clients are used. But in the WWW arena, you just don't know what clients are going to be used. -Original Message- From: Adam Voigt [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 11, 2003 10:25 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: [PHP-DB] collaborating on a document Riiight, anyway, since Adobe Acrobat is the worst possible answer for updating in real time (and completely wouldn't work), I would say, yes, two frames should work, but you might even want a third (hidden) at the bottom that never stops executing, just pulling entry's out when new ones are added, and use _javascript_ to add them to the right frames with the ideas. On Tue, 2003-02-11 at 10:16, Hutchins, Richard wrote: 1. This question has nothing to do with PHP or databases. 2. Adobe already thought of it: Adobe Acrobat 5.0. -Original Message- From: Baumgartner Jeffrey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 11, 2003 10:13 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] collaborating on a document I'm thinking about making a little tool where people can contribute ideas in real time. Thus far, the best way I can see to do this is via 2 frames Frame 1: for entering data - which is inserted into a table. Frame 2: would select from the table. It would also refresh frequently - say every 30 seconds. But perhaps you have a more elegant solution? Thanks, Jeffrey Baumgartner eBusiness Consultant - ITP Europe http://www.itp-europe.com [EMAIL PROTECTED] +32 2 721 51 00 -- 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 -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
Re: [PHP-DB] Storing iterated results into various variables
$counter = 1; $query = mysql_query(SELECT image,caption FROM tablename ORDER BY id;); while($row = mysql_fetch_array($query)) { $imagevar = image . $counter; $captionvar = caption . $counter; $$imagevar = $row[image]; $$captionvar = $row[caption]; $counter++; } Change the query to match what you need, and that should work, if your interested, check out the manual page on Variable Variables at: http://www.php.net/manual/en/language.variables.variable.php Enjoy. On Tue, 2003-02-04 at 07:02, Geckodeep wrote: May be some one could help me here, I am trying to retrieve results from a table that gives 9 rows, from each row I am trying to pull out two fields and assign the two values of those column fields to a variable $image1 and $caption1, and now I want to go to the next row and pick up the values of the corresponding fields and store it in the next variable $image2 and $caption2 and to continue until I reach 9 rows. The reason for this technique is I am trying to inject the dynamic data inside a page which is already formatted with HTMLs (kind of template) and by means of Php tags I can echo these variables where needed. Thanks for your time and help in advance I'd appreciate it. GD -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
Re: [PHP-DB] Date format in MySQL
$query = mysql_query(SELECT UNIX_TIMESTAMP(fieldname) AS date WHERE id = '1';); $array = mysql_fetch_array($query); $mydate = date(j F, Y,$array[date]); Change fieldname and the where clause, and that should work. If you want to further munipulate how it looks, just look at the date manual page: http://www.php.net/date And change the first parameter to the date function. On Mon, 2003-02-03 at 09:09, RUBANOWICZ Lisa wrote: Hi All, I have a date format of -MM-DD in MySQL and am showing it on a PHP page. However I want to show it as 2 February, 2003 or 2 February Can someone please help me. The date will not necessarily be todays date (I looked at the datetime() function and the getdate() function but couldn't work it out for these) Thanks for your support All the best Lisa Lisa Rubanowicz CNH Ireland Tel: +353 46 77663 Email: mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
RE: [PHP-DB] Send mail with a file
Unix has nothing to do with it, the mail command in PHP on unix is the same mail command in PHP on windows. If you want to use attachments you need to use a class like phpMimeEmail or whatever it's called go to phpclasses.org, it's on there somewhere. On Thu, 2003-01-16 at 09:33, NIPP, SCOTT V (SBCSI) wrote: Under Unix I don't know that this is possible, but hopefully someone else will know of a way. I would love to be able to e-mail some Excel files that I generate with a Perl cron job, but there does not appear to be any practical way to do this in Unix. -Original Message- From: Bruno Pereira [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 16, 2003 3:47 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP-DB] Send mail with a file How can i insert a file on a mail, with the command mail()? It is possible? Cumprimentos Bruno Pereira [EMAIL PROTECTED] -Original Message- From: Bruno Pereira [mailto:[EMAIL PROTECTED]] Sent: quarta-feira, 15 de Janeiro de 2003 14:48 Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Concatenate two strings How can i join two strings. My code is something like: $valor1=bruno; $valor2=Pereira; $valor=$valor1 + + $valor2 Can someone help me. Thanks. Cumprimentos Bruno Pereira [EMAIL PROTECTED] -- 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 -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
Re: [PHP-DB] data move
Umm, if it's a one time deal, why not just have access output a CSV (comma seperated version, or something like that) and use PHP or phpMyAdmin if it will do it, to do your insert's? That way you don't have to have PHP interface with Access, just the MySQL part which is real easy. On Mon, 2003-01-13 at 09:12, Edward Peloke wrote: Ok, I know I have asked this question several times but it is time for me to start coding so I am looking for some goog tutorials somewhere. I need to use php to transfer data from an access file to mysql db. I assume I will just use an odbc connection but I am unsure as to where to start. If anyone knows of any good tutorials or samples, please point me in the right direction. Thanks, Eddie -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
Re: [PHP-DB] keyword search a mysql database.
$searchstring = $_POST[searchfor]; $searchstring = str_replace( ,%,$searchstring); mssql_query(SELECT id FROM table WHERE field LIKE '$searchstring';); This will give you a looser search where all search terms have to be there, but not necessarily next to each other, if you want a phrase search so they have to follow each other: $searchstring = % . $_POST[searchfor] . %; mssql_query(SELECT id FROM table WHERE field LIKE '$searchstring';); Make sense? On Wed, 2002-12-18 at 12:44, mike karthauser wrote: I'm looking for tips and tricks in how to approach building a keyword search over an number of fields in a courses database. I know how i can search for one word at a time, but i am not sure on how i would approach searching via a defined string. Anyone got any good pointers for doing this/ or some tutorial that i can read though? Thanks.. BTW kettles on if anyone wants a brew.. -- Mike Karthauser Managing Director - Brightstorm Ltd Email[EMAIL PROTECTED] Web http://www.brightstorm.co.uk Tel 0117 9426653 (office) 07939 252144 (mobile) SnailmailUnit 8, 14 King Square, Bristol BS2 8JJ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
Re: [PHP-DB] Get error message, need help
Your missing a semicolon (;) after your first $myquery = line. - Original Message - From: David [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, December 16, 2002 2:16 AM Subject: [PHP-DB] Get error message, need help Hello all, I am new to PHP so I am going to need some help. I am trying to create a admin login page. But I am getting this error message: Parse error: parse error, unexpected T_VARIABLE in c:\program files\apache group\apache\htdocs\sunwestsilver\admin\tmpi5pcf76sy9.php on line 43 tmpi5pcf76sy9.php is generated by Dreamweaver MX as a temp file from admin.php It is coming from this line: this is line 43 code # $myquery = .' AND password = ' . crypt($password, xpz8ty) . '; The complete code is: // Query Database with username and encrypted password #$myquery = SELECT * FROM user WHERE username = ' . $user #$myquery = .' AND password = ' . crypt($password, xpz8ty) . '; #$result = mysql_query($myquery); #if (!$result) #{ # $error = Cannot run Query; #return($error); #} Any help will be nice. I got this code from Dreamweaver MX: PHP Web Development pg. 257 Thanks David -- 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 -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
[PHP-DB] MSSQL Text Length Restriction
I can't seem to get more then 255 characters to be sent back from a field in our MSSQL database, unless the fields is a TEXT type, which is very inefficient. Anyone know a fix? (I've already tried modifying the max size variables in the php.ini under the MSSQL section.) -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
RE: [PHP-DB] MSSQL Text Length Restriction
Didn't work, thanks anyway. On Tue, 2002-12-10 at 10:43, [EMAIL PROTECTED] wrote: this little snippet works for me. mssql_query(set textsize 65536); HTH Jeff Adam Voigt adam@cryptoco To: Hutchins, Richard [EMAIL PROTECTED] mm.com cc: [EMAIL PROTECTED] Subject: RE: [PHP-DB] MSSQL Text Length Restriction 12/10/2002 10:35 AM Ok, my question was in reguards to Microsoft SQL (MSSQL), you are referering to MySQL. On Tue, 2002-12-10 at 10:21, Hutchins, Richard wrote: Look at the tinyblob (tinytext), mediumblob (mediumtext), blob (text), longblob (longtext)column types in the MySQL manual. Storage-wise they don't look too terribly inefficient. -Original Message- From: Adam Voigt [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 10, 2002 10:18 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] MSSQL Text Length Restriction I can't seem to get more then 255 characters to be sent back from a field in our MSSQL database, unless the fields is a TEXT type, which is very inefficient. Anyone know a fix? (I've already tried modifying the max size variables in the php.ini under the MSSQL section.) -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
RE: [PHP-DB] MSSQL Text Length Restriction
Uncommented, and set to the max value (2147483647). No effect. On Tue, 2002-12-10 at 10:57, [EMAIL PROTECTED] wrote: Adam. are these lines uncommented in your php.ini? They are under [MSSQL] ; Valid range 0 - 2147483647. Default = 4096. ;mssql.textlimit = 4096 ; Valid range 0 - 2147483647. Default = 4096. ;mssql.textsize = 4096 sorry, i'm not replying to the other email. i deleted it accidentally Jeffrey N Dyke To: Adam Voigt [EMAIL PROTECTED] 12/10/2002 cc: [EMAIL PROTECTED], Hutchins, Richard 10:43 AM [EMAIL PROTECTED] Subject: RE: [PHP-DB] MSSQL Text Length Restriction(Document link: Jeff Dyke) this little snippet works for me. mssql_query(set textsize 65536); HTH Jeff Adam Voigt adam@cryptoco To: Hutchins, Richard [EMAIL PROTECTED] mm.com cc: [EMAIL PROTECTED] Subject: RE: [PHP-DB] MSSQL Text Length Restriction 12/10/2002 10:35 AM Ok, my question was in reguards to Microsoft SQL (MSSQL), you are referering to MySQL. On Tue, 2002-12-10 at 10:21, Hutchins, Richard wrote: Look at the tinyblob (tinytext), mediumblob (mediumtext), blob (text), longblob (longtext)column types in the MySQL manual. Storage-wise they don't look too terribly inefficient. -Original Message- From: Adam Voigt [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 10, 2002 10:18 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] MSSQL Text Length Restriction I can't seem to get more then 255 characters to be sent back from a field in our MSSQL database, unless the fields is a TEXT type, which is very inefficient. Anyone know a fix? (I've already tried modifying the max size variables in the php.ini under the MSSQL section.) -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc -- Adam Voigt ([EMAIL PROTECTED
Re: [PHP-DB] Refining my search app..
A little cleaner: switch($_POST[column]) { case(foo):$query = mysql_query(WHATVER);break; case(too):$query = mysql_query(BLAH);break; default:$query = mysql_query(DOH);break; } while($row = mysql_fetch_array($query)) { // DO SOMETHING } -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
Re: [PHP-DB] Connecting to MS SQL 7
A. I think the php3_ isn't a good sign. B. You should remove whatever you found on the web and downloaded. C. Copy all the DLL's in the dll folder (under your PHP folder) to C:\WINNT\SYSTEM32 D. Re-copy the php.ini-recommended from your PHP folder to C:\WINNT\php.ini and see if it stops looking for php3. On Tue, 2002-11-26 at 18:36, Mark Farmer wrote: I have successfully installed PHP 4.2.3 on a Win NT 4 server, running IIS 4, and can execute PHP functions now. However, when I try to connect to an MS SQL 7 database on the same box, I receive this error: PHP Warning: Unable to load dynamic library './php3_mssql70.dll' - %1 is not a valid Windows NT application, and my mssql_connect statment fails. What I had done was to find a copy of php3_mssql70.dll on the web and copy it onto the server -- various faqs told me this needed to happen in order for database calls to work. Why isn't this dll being recognized as a valid Windows NT application, then? Thank you. _ STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
Re: [PHP-DB] Resource id #2
Umm, he is putting them into an array, I quote: while ($row = mysql_fetch_array($result)) { $row['Books.Title']; $row['Books.Author']; $row['Books.ISBN']; $row['BookList.dbase']; $row['BookList.dbase_user']; $row['BoxSet.BoxSet']; $row['Category.Category']; $row['Category.Sub_category']; $row['Publisher.Publisher']; $row['AuthUsers.email']; } See the while condition? On Wed, 2002-11-27 at 06:03, Chris Barnes wrote: You need to put your $result into an array. you can use: $result_array = mysql_fetch_array($result); then, if you know the field names in the array, print them like so: echo $result_array[field1]; echo $result_array[field2]; or if you dont know their names you can refer to their position numbers starting from 0 e.g. echo $result_array[0]; echo $result_array[1]; using the position numbers you could put together a quick script to crawl through the array and print all the fields with a few lines of code. On Wed, 2002-11-27 at 05:09, The Cossins Fam wrote: Hello. I am using MySQL as a database for a departmental library. I have written a quick search script, but keep getting resource id #2 as a result to my search. I have read the online documentation for the mysql_fetch_array() function and must say, I don't see that I'm missing anything. However, I've only started programming, much less working with PHP, so perhaps someone can help me out. Here's my code: ? $quickSearch = mcse; $table1 = Books; $table2 = BookList; $table3 = BoxSet; $table4 = Category; $table5 = Publisher; $table6 = AuthUsers; $table7 = CD; $connection = mysql_connect(localhost, root) or die(Couldn't connect to the library database.); $db_select = mysql_select_db(library, $connection) or die(Couldn't select the library database.); $search = SELECT * FROM $table1 LEFT JOIN $table2 ON Books.BookListID = BookList.BookListID LEFT JOIN $table3 ON Books.BoxSetID = BoxSet.BoxSetID LEFT JOIN $table4 ON Books.CategoryID = Category.CategoryID LEFT JOIN $table5 ON Books.PublisherID = Publisher.PublisherID LEFT JOIN $table6 ON Books.auID = AuthUsers.auID LEFT JOIN $table7 ON Books.CD = CD.CD_ID WHERE Books.Title LIKE \%'$quickSearch'%\ OR Books.Author LIKE \%'$quickSearch'%\ OR Books.ISBN LIKE \%'$quickSearch'%\ OR BookList.dbase LIKE \%'$quickSearch'%\ OR BookList.dbase_user LIKE \%'$quickSearch'%\ OR BoxSet.BoxSet LIKE \%'$quickSearch'%\ OR Category.Category LIKE \%'$quickSearch'%\ OR Category.Sub_category LIKE \%'$quickSearch'%\ OR Publisher.Publisher LIKE \%'$quickSearch'%\; $result = mysql_query($search, $connection) or die(Couldn't search the library.); while ($row = mysql_fetch_array($result)) { $row['Books.Title']; $row['Books.Author']; $row['Books.ISBN']; $row['BookList.dbase']; $row['BookList.dbase_user']; $row['BoxSet.BoxSet']; $row['Category.Category']; $row['Category.Sub_category']; $row['Publisher.Publisher']; $row['AuthUsers.email']; } ? I then have some HTML to display the result of the search. I don't receive any error messages - I just see an empty table from the HTML code I wrote. I added an echo of the $result to find the resouce id #2. Thanks for any help you can provide. --joel _ The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
Re: [PHP-DB] PHP4, Apache 1.3.x, and mod ssl install document?
Off the top of my head (general guidelines, don't use word for word): mkdir /usr/local/apache cd /usr/local/apache wget http://www.apache.org/dist/httpd/apache_1.3.27.tar.gz tar -zxf * cd apache_1.3.27 ./configure --prefix=/usr/local/apache_1.3.27 mkdir /usr/local/modssl cd /usr/local/modssl wget http://www.modssl.org/source/mod_ssl-2.8.12-1.3.27.tar.gz tar -zxf * cd mod_ssl-2.8.12-1.3.27 ./configure --with-apache=/usr/local/apache/apache_1.3.27 cd /usr/local/apache/apache_1.3.27 ./configure --prefix=/usr/local/apache_1.3.27 --enable-module=ssl --enable-module=so make make certificate type=test (OPTIONAL) make install mkdir /usr/local/php cd /usr/local/php lynx http://www.php.net/do_download.php?mr=http%3A%2F%2Fwww.php.net%2Fdf=php-4.2.3.tar.gz (Save the file with lynx) tar -zxf * cd php_4.2.3 ./configure --with-apxs=/usr/local/apache_1.3.27/bin/apxs --with-mysql=/usr make make install Add the line: application/x-httpd-php .php To somewhere near the bottom of your httpd.conf and while your in httpd.conf configure the values you like. On Wed, 2002-11-27 at 10:38, RClark wrote: Hello all, I have a FreeBSD server which has been updated to 4.7 STABLE. I have updated my ports collection and installed mysql server. Does anyone have an updated doc on how to install apache with PHP4 and modssl support either from ports collection or from source. I would greatly appreciate it. Thanks Ron -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
Re: [PHP-DB] Resource id #2
They don't do anything, but my point was, he said that what he pulled from the DB needed to be put into an array, and I was pointing out, it already was. On Wed, 2002-11-27 at 12:23, Mark wrote: But what do all those $row['fieldname'} rows do? Call me ignorant (you wouldn't be the first), but a statement that simply has a variable name doesn't DO anything. Should these have echos in front of them? --- Adam Voigt [EMAIL PROTECTED] wrote: Umm, he is putting them into an array, I quote: while ($row = mysql_fetch_array($result)) { $row['Books.Title']; $row['Books.Author']; $row['Books.ISBN']; $row['BookList.dbase']; $row['BookList.dbase_user']; $row['BoxSet.BoxSet']; $row['Category.Category']; $row['Category.Sub_category']; $row['Publisher.Publisher']; $row['AuthUsers.email']; } See the while condition? On Wed, 2002-11-27 at 06:03, Chris Barnes wrote: You need to put your $result into an array. you can use: $result_array = mysql_fetch_array($result); then, if you know the field names in the array, print them like so: echo $result_array[field1]; echo $result_array[field2]; or if you dont know their names you can refer to their position numbers starting from 0 e.g. echo $result_array[0]; echo $result_array[1]; using the position numbers you could put together a quick script to crawl through the array and print all the fields with a few lines of code. On Wed, 2002-11-27 at 05:09, The Cossins Fam wrote: Hello. I am using MySQL as a database for a departmental library. I have written a quick search script, but keep getting resource id #2 as a result to my search. I have read the online documentation for the mysql_fetch_array() function and must say, I don't see that I'm missing anything. However, I've only started programming, much less working with PHP, so perhaps someone can help me out. Here's my code: ? $quickSearch = mcse; $table1 = Books; $table2 = BookList; $table3 = BoxSet; $table4 = Category; $table5 = Publisher; $table6 = AuthUsers; $table7 = CD; $connection = mysql_connect(localhost, root) or die(Couldn't connect to the library database.); $db_select = mysql_select_db(library, $connection) or die(Couldn't select the library database.); $search = SELECT * FROM $table1 LEFT JOIN $table2 ON Books.BookListID = BookList.BookListID LEFT JOIN $table3 ON Books.BoxSetID = BoxSet.BoxSetID LEFT JOIN $table4 ON Books.CategoryID = Category.CategoryID LEFT JOIN $table5 ON Books.PublisherID = Publisher.PublisherID LEFT JOIN $table6 ON Books.auID = AuthUsers.auID LEFT JOIN $table7 ON Books.CD = CD.CD_ID WHERE Books.Title LIKE \%'$quickSearch'%\ OR Books.Author LIKE \%'$quickSearch'%\ OR Books.ISBN LIKE \%'$quickSearch'%\ OR BookList.dbase LIKE \%'$quickSearch'%\ OR BookList.dbase_user LIKE \%'$quickSearch'%\ OR BoxSet.BoxSet LIKE \%'$quickSearch'%\ OR Category.Category LIKE \%'$quickSearch'%\ OR Category.Sub_category LIKE \%'$quickSearch'%\ OR Publisher.Publisher LIKE \%'$quickSearch'%\; $result = mysql_query($search, $connection) or die(Couldn't search the library.); while ($row = mysql_fetch_array($result)) { $row['Books.Title']; $row['Books.Author']; $row['Books.ISBN']; $row['BookList.dbase']; $row['BookList.dbase_user']; $row['BoxSet.BoxSet']; $row['Category.Category']; $row['Category.Sub_category']; $row['Publisher.Publisher']; $row['AuthUsers.email']; } ? I then have some HTML to display the result of the search. I don't receive any error messages - I just see an empty table from the HTML code I wrote. I added an echo of the $result to find the resouce id #2. Thanks for any help you can provide. --joel _ The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc ATTACHMENT part 2 application/pgp-signature name=signature.asc = Mark Weinstock [EMAIL PROTECTED] *** You can't demand something
[PHP-DB] MySQL/PHP Iterative Tree
Ok, I've been racking my brain trying to figure this one out, so I thought I'd post the question here and see who bytes. =) I have a table: id INTEGER, PRIMARY KEY parentid INTEGER DEFAULT (0) name VARCHAR(32) NOT NULL Ok, and I am using this structure to make a kind of drill down structure, so the top level would be where parentid = '0', then you take those id's and select from this table where parentid is equal to those id's, and now your starting to navigate through the tree, and so on. Now, the real question, I have found a Javascript menu script which will let users of the site click on it, and then click on the submenu and down and down through all the level's that might dynamically exist, but I can't for the life of me figure out how to recursively get the name and id for each row (which is what I need to build the menu and make link's out of each item), for as many sublevel's as there might be (infinite). Am I missing something, is there a simple logical way to do this recursively? Or if there's a semi-complex way, anyone got a script example? I'd very much appreciate it. -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
Re: [PHP-DB] Re: MySQL/PHP Iterative Tree
A coworker suggested I just write either the array or the actual menu itself (in a .js file) at the time of category/subcategory creation and just include it on the page with the menu, which I suppose is what I must do since most other on-the-fly solutions seem fairly complicated and can get exponentially resource intensive. Thanks for your help. On Tue, 2002-11-26 at 11:07, David Elliott wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello 1LT On 26 November 2002 at 09:54:57 -0500 (which was 14:54 where I live) 1LT John W. Holmes emanated these words of wisdom You may want to check out using Nested Sets instead of a Parent-Child-ID system. This is OK for some simple trees, however it does have some limitations. (1) Adding another tree / series of nodes into the middle if the set. (2) A child node that belongs to more than one parent. - -- Cheers, ___ David |David Elliott| Software Engineer| _| [EMAIL PROTECTED] | PGP Key ID 0x650F4534 | | Mathematicians DO IT with sum. | -BEGIN PGP SIGNATURE- Version: 6.5.8ckt http://www.ipgpp.com/ iQA/AwUBPeOcYPmK8eZlD0U0EQJRVACfXZGjwwUlKOV1yEvtEf96D0MdNakAnAuF PBlwh2HSenDKSVvldLp8H3fb =QE8q -END PGP SIGNATURE- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
Re: [PHP-DB] Resource id #2
Add: print_r($row) In your while loop, that will show you everything that is being returned with both it's numeric and text based position. On Tue, 2002-11-26 at 13:09, The Cossins Fam wrote: Hello. I am using MySQL as a database for a departmental library. I have written a quick search script, but keep getting resource id #2 as a result to my search. I have read the online documentation for the mysql_fetch_array() function and must say, I don't see that I'm missing anything. However, I've only started programming, much less working with PHP, so perhaps someone can help me out. Here's my code: ? $quickSearch = mcse; $table1 = Books; $table2 = BookList; $table3 = BoxSet; $table4 = Category; $table5 = Publisher; $table6 = AuthUsers; $table7 = CD; $connection = mysql_connect(localhost, root) or die(Couldn't connect to the library database.); $db_select = mysql_select_db(library, $connection) or die(Couldn't select the library database.); $search = SELECT * FROM $table1 LEFT JOIN $table2 ON Books.BookListID = BookList.BookListID LEFT JOIN $table3 ON Books.BoxSetID = BoxSet.BoxSetID LEFT JOIN $table4 ON Books.CategoryID = Category.CategoryID LEFT JOIN $table5 ON Books.PublisherID = Publisher.PublisherID LEFT JOIN $table6 ON Books.auID = AuthUsers.auID LEFT JOIN $table7 ON Books.CD = CD.CD_ID WHERE Books.Title LIKE \%'$quickSearch'%\ OR Books.Author LIKE \%'$quickSearch'%\ OR Books.ISBN LIKE \%'$quickSearch'%\ OR BookList.dbase LIKE \%'$quickSearch'%\ OR BookList.dbase_user LIKE \%'$quickSearch'%\ OR BoxSet.BoxSet LIKE \%'$quickSearch'%\ OR Category.Category LIKE \%'$quickSearch'%\ OR Category.Sub_category LIKE \%'$quickSearch'%\ OR Publisher.Publisher LIKE \%'$quickSearch'%\; $result = mysql_query($search, $connection) or die(Couldn't search the library.); while ($row = mysql_fetch_array($result)) { $row['Books.Title']; $row['Books.Author']; $row['Books.ISBN']; $row['BookList.dbase']; $row['BookList.dbase_user']; $row['BoxSet.BoxSet']; $row['Category.Category']; $row['Category.Sub_category']; $row['Publisher.Publisher']; $row['AuthUsers.email']; } ? I then have some HTML to display the result of the search. I don't receive any error messages - I just see an empty table from the HTML code I wrote. I added an echo of the $result to find the resouce id #2. Thanks for any help you can provide. --joel _ The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
[PHP-DB] Get Last ID Inserted
Using Microsoft SQL does anyone know how to get the id of the row that you just inserted without clumsily trying to select the id back based on the same criteria of your insert (which might be overlapping)? -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
Re: [PHP-DB] inserting html into mysql tables
Well for one, VARCHAR is limited to 255 characters, so I would use a TEXT type datafield if you want to store more then 255. On Thu, 2002-11-21 at 11:01, mike karthauser wrote: hi, is there anything special i need to know in regards to creating a table to hold html data? I am building a CMS for a site using php and mysql. The various tables hold course information that the client wants to edit. I imagine it will be a case of dropping the cleaned html source from dreamweaver into a form box and posting it to the table. What would a good varchar(?) be for say 5K of data? cheers mikek -- Mike Karthauser Managing Director - Brightstorm Ltd Email[EMAIL PROTECTED] Web http://www.brightstorm.co.uk Tel 0117 9426653 (office) 07939 252144 (mobile) SnailmailUnit 8, 14 King Square, Bristol BS2 8JJ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
Re: [PHP-DB] Re: Get Last ID Inserted
But if there are heavy operations on the site, will this not also pick up a different last inserted id, if in the split milisecond between the insert and the next mssql_query which has the @@identity say, another user does an insert? On Thu, 2002-11-21 at 11:03, David Elliott wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello Adam On 21 November 2002 at 10:47:15 -0500 (which was 15:47 where I live) Adam Voigt wrote Using Microsoft SQL does anyone know how to get the id of the row that you just inserted without clumsily trying to select the id back based on the same criteria of your insert (which might be overlapping)? select @@identity - -- Cheers, ___ David |David Elliott| Software Engineer| _| [EMAIL PROTECTED] | PGP Key ID 0x650F4534 | | No dinner with Mel Gibson?! - Dot Warner| -BEGIN PGP SIGNATURE- Version: 6.5.8ckt http://www.ipgpp.com/ iQA/AwUBPd0DwfmK8eZlD0U0EQI3fACgsv52o5AvhuroJIVYblYXTnkiDZYAn2Ao y1AeA+bR4KPOwZhZTAa2x7kr =f/lr -END PGP SIGNATURE- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
Re: [PHP-DB] Re: Get Last ID Inserted
Ahh, thanks very much. On Thu, 2002-11-21 at 12:08, David Elliott wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello Adam On 21 November 2002 at 11:12:46 -0500 (which was 16:12 where I live) Adam Voigt rearranged electrons to get But if there are heavy operations on the site, will this not also pick up a different last inserted id, if in the split milisecond between the insert and the next mssql_query which has the @@identity say, another user does an insert? No. It picks up the last identity on that connection. So it does not mater how many other connections and what they are doing. It can only be wrong if you close off the connection and open another one. The other way is to put it all into one SQL statement (as long as you don't use mssql_? functions in PHP) e.g. (one I used earlier) ==8= begin transaction set nocount on declare @NewId int update item set name = 'Canada Delivery' where itemid = '428' insert into item (ItemTypeId, Name, LastUpdated) values (49,'Mexico Delivery',getutcdate()) set @NewId = @@identity insert into DelArea (itemid,StdEUR, StdGBP, StdUSD, HotEUR, HotGBP, HotUSD) values (@NewId,37,19,45,134,70,70) Update country set DelId = @NewId where itemid = 288 commit select @NewId NewDelId ==8= - -- Ti2GO,___ David |David Elliott| Software Engineer| _| [EMAIL PROTECTED] | PGP Key ID 0x650F4534 | | Do you think someone was BORGED when they made these up?| -BEGIN PGP SIGNATURE- Version: 6.5.8ckt http://www.ipgpp.com/ iQA/AwUBPd0TBPmK8eZlD0U0EQL1awCgmS57QwyvS+bz02XsLQtwJOSGSB8AoLmo I9VdgNIsp3GXkzWAX6I1jYpp =UXBQ -END PGP SIGNATURE- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
Re: [PHP-DB] Fastest, easiest Flatfile DB with PHP
For massive amounts of data, you really want to use some type of SQL database. Not only will you save time programming, but massive server resources aswell since the disk doesn't have to parse and seek a large flatfile everytime. On Mon, 2002-11-18 at 09:15, Teemu Pentinsaari wrote: hi, Maybe someone here can point me the way ... I'm looking for a fast and easy to use flatfile database working with PHP. The amount of stored data, the frequency and number of queries are really massive so I'm hoping to be able to skip MySql and build this service with some alternative technique. Anyone ? thanks Teemu -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
Re: [PHP-DB] Multiple Inserts with mySQL
10 Seconds searching in the MySQL Manual: http://www.mysql.com/doc/en/ANSI_diff_Transactions.html You have to use InnoDB tables, but this will work. On Thu, 2002-11-14 at 11:26, Anthony wrote: hmm, I guess that would work. There is no way to have mySQL check for integrity for me is there? I read in a SQL book a while ago about wrapping multiple inserts in a select statement, that way if any part of the statement failed the whole thing would be rolled back. From my research though, it doesn't look like mySQL supports this. Am I right here? So far it looks like your idea could be the most reliable suggestions I've gotten, so I'll start working on that for now. Thanks. - Anthony Peter Beckman wrote: Try this: $stack is an array of hashes: $stack[0] = array(0=tablename, 1=insertid()); For each insert you do, push an anonymous array on $stack which includes the tablename and insertid of the insert. Then as you continue your inserts, if any of them fail, call a function which takes that array $stack, and iterate through it, deleting the rows you just inserted. (see mysql_insert_id() function to get the insert ID) If none of them do fail, then you are in the clear. Either unset $stack or ignore it. Peter On Wed, 13 Nov 2002, Anthony wrote: I have to drop a lot of data into mySQL from PHP. It will go into quite a few different tables. How can I maintain integrity of the entire insert? I need to do about a dozen inserts on four tables and I need to insure that all the inserts are successful or that none of them get done. I'm sort of new at this, so please help me out. Thanks. - Anthony -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Peter BeckmanSystems Engineer, Fairfax Cable Access Corporation [EMAIL PROTECTED] http://www.purplecow.com/ --- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
Re: [PHP-DB] MySql Update.
$query = UPDATE tablename SET ; foreach($_POST AS $key = $value) $query .= $key = '$value',; $query[strlen($query)-1] = ; $query .= WHERE id = '$_GET[id]'; Or something? On Tue, 2002-11-12 at 13:58, David Rice wrote: Making an update query that adapts to the number of fields that are to be updated Is there anyway to do like a for loop to create the values part of the query then combine it with the first part of the string. something like what i have below... although something that works correctly as this doesn't. == $table is the table name $num_headers is the number of headers (fieldnames) for that table $table_headers is an array with the names of the headers $values is an array with the names of the input boxes on the previous page == $query1 = UPDATE .$table. SET ; $query2 = ( for ($x=0; $x =$num_headers; $x++){ . $table_headers[$x] . = . $values[$x] . , }) ; $query = $query1.$query2 ; $result = mysql_query ($query) ; etc... _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
Re: [PHP-DB] MySQL password protection?
Make the include file (or wherever your page with the pass is) encrypted, see ioncube.com they charge by the amount of code you incrypt, for a simple database include file, I think it would be $1 or less. On Wed, 2002-11-06 at 16:04, William Trappeniers wrote: Hi all I was wondering if it is possible to protect my password to the MySQL-server from being in a PHP-script. Now I can't do that, so everybody who gets to see my php-sourcecode also can see my (not protected/not encrypted) password. How can I change this? Thanks, William --- William Trappeniers mail at: [EMAIL PROTECTED] -- 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] first Array value duplicating..
Ok, here's how I do it: =) Delete checkbox's (assuming this is being called recursively, once for each row in the db): input type=checkbox name=delete[] value=$row[id] And on submition: foreach($_POST[delete] AS $row) mysql_query(DELETE FROM tablename WHERE id = '$row';); Adam Voigt [EMAIL PROTECTED] Hi All, In a form I have checkboxes associated with order records. The checkboxes are for deleting order records (should a client choose to do so). It looks like this: form name=form action=process_bank.php method=POST input type=hidden name=order_index[0] value=1 td class=cartlink align=centerinput type=checkbox name=delete[0] value=1/td input type=hidden name=order_index[1] value=3 td class=cartlink align=centerinput type=checkbox name=delete[1] value=1/td input type=hidden name=order_index[2] value=8 td class=cartlink align=centerinput type=checkbox name=delete[2] value=1/td input type=hidden name=order_index[3] value=12 td class=cartlink align=centerinput type=checkbox name=delete[3] value=1/td /form Now.. when the process button is pressed the information is carried off to the process_bank.php script. Lets assume for this example.. I selected the checkbox delete[0] (which equals value 1) and delete[3] (which equals value 12). In the script I have this code: for ($i=0;$isizeof($order_index);$i++) { $orderQuery = db_query(SELECT id FROM TestOrderTable WHERE id=.$order_index[$i]); $orderResult = db_fetch($orderQuery); if ($delete[$i] == 1) { $ids .= $orderResult[id]; echo $ids; } } The echo'd value that I get is 1,1,12 when it should be 1,12. When only ONE checkbox is selected I just get the one value displayed (i.e. if I selected the first checkbox the echo'd value would be 1). Does anyone know why the first value is being duplicated on a multiple select but not on a single select? Sorry if this sounds confusing :( Aaron -- 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] I need Microsoft SQL Library: mssql70.so
You need the FreeTDS connection library (it works wonders for us): Goto www.freetds.org Download it Configure, make, make install it Edit your freetds config file to your needs Add the --with-sybase=/path/to/freetds to your PHP configure line yes, I know that says sybase, but trust me, it works. Adam Voigt [EMAIL PROTECTED] On Wed, 2002-10-02 at 12:48, Leo Hotmail wrote: I've installed Linux Red Hat 7.1 with php 4 and have the this libraries in /usr/lib/php4 pgsql.so ldap.so imap.so but I need Microsoft SQL Library: mssql70.so how can I install it? Leo -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP in a javascript function with DB calls.
Umm, the body tag in HTML has an onLoad parameter. So: body bgcolor=black onload=javascript:window.new('url'); That code for the window.new is probably wrong, but that will do it. Adam Voigt [EMAIL PROTECTED] On Tue, 2002-09-10 at 11:20, Aaron Wolski wrote: Hi All, I HOPE this is the right place for this.. if not I am sorry!!! I'm hoping someone can put me on a clear path of how to do what I am asking here. I Have a shopping cart... and in this shopping cart I want to feature some items in a pop_up window when the user is ready to check out - if they are not already selected. For example.. Someone buy a Hockey Stick but don't buy hockey tape.. when when they go to check out.. I want a pop_up to be launched asking the user if they want to add Hockey tape to their order for onlu $$$. For this to happen I need to have an onLoad on the checkout page that calls a javascript function that has PHP code to find out IF a paritcular product is selected to see if the other has been selected too, if it's NOT selected then launch the pop_up. Does ANYONE have any idea's as to how this can be accomplished?? Anyhelp is appreciated thanks all. Aaron -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP4 MSSQL Error handling
$result = mssql_query($query) or die(mssql_get_last_message()); Adam Voigt [EMAIL PROTECTED] On Wed, 2002-07-24 at 19:48, Salve Tinkerworth wrote: Does anyone have any good tips for error handling? I've tried different methods to retrieve good error information from mssql_query but nothing seems to be working. Here's the latest attempt: $result=mssql_query($sql2); $result=mssql_query('SELECT @@ERROR As ErrorCode'); $error=mssql_fetch_row($result); if($error['ErrorCode'] != 0) { echo $error['ErrorCode']; echo $sql2; die('Inserting OPS failed'); } -- 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] mssql datetime field
Could you give an example of what you are sending in as the date value in an Insert/Update? Adam Voigt [EMAIL PROTECTED] On Thu, 2002-07-25 at 08:45, [EMAIL PROTECTED] wrote: has anyone had any expierence with the datetime field coming back from MSSQL as someting along the lines of February 3, 2036 6:36AM. This happens to me no matter the time in the database. PHP inserts it correctly, but the select has a problem. I am using php4.1.2 and SqlServer 7.0. Or is anyone haveing success, in new versions of PHP. Upgrading PHP is no problem, upgrading SQL is not an option Thanks in advance. Jeff -- 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] extract data from database into an array
$query = mysql_query(SELECT whatever FROM whatever;); while($row = mysql_fetch_array($query)) $construct[] = $row[whatever]; That will give you an array (construct) with position 0 being the first row, position 1 being the second row, and so on. Adam Voigt [EMAIL PROTECTED] On Mon, 2002-07-15 at 13:04, [EMAIL PROTECTED] wrote: Adam Alkins [EMAIL PROTECTED] wrote on 07/13/2002 07:56:46 PM: I have a database, all the data is numbers. I want to make a query that will extract the data and then make it available in an array, so the array is populated 'real-time'. I could just enter the number into an array manually, but I want to automate the job. I don't know what to start looking for, the 3 books I have either don't talk about this or I just am missing it. Could someone point me in the right direction? Well after you SELECT the data and run the query, you can use a few functions, it depends on your database type? For example, for MySQL, you can use mysql_fetch_array() which will take your data and store it in an array, both numeric and associative. i.e. $data = mysql_fetch_array($result) can be accessed like $data['column_name'] $data[column_number] You can also fetch an array only as an associative (mysql_fetch_assoc) or numeric (mysql_fetch_row). And simply if selecting multiple rows, use a loop while($data = mysql_fetch_array())... -- Adam Alkins I guess I wasn't very clear on exactly what results I expect. I can get the data and print all the numbers, that's no problem. What I want is to have all the numbers inserted into an array that would look like this: $datax = (50,50,50,60,60,60,70,70,70,65,65,70,75,75,80); Each number in the array is from a single row in the table (15 rows in this example). The database is weights, entered after a work-out, along with their reps. I only need the weights, as shown above. This array $datax is then processed by a php script to create a graph showing the progress of the person's wieght lifting over time. I can enter all the numbers into the array manually and the graph is drawn correctly, but prefer the web interface I made. This is okay for me, but not others. So, I made a web form that takes the data and inserts into the database. That works fine also. The table contains columns: squats, squats_reps, legpress, legpress_reps, etc etc. The first is the weight and the second is the number of reps. So after each workout the appropriate numbers would be entered via the form page, the graph would be generated with the updated numbers from another page. Hope this helps to explain it a bit better, -- Chip http://www.rasadam.com -- -- 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] MySQL Clustering, redundancy
Yes,it's called Replication in the MySQL documentation. However, since the info in the manual is kind of sparse so I would hop on google and do a search for specific instructions on how to do it when your ready, but to answer your question, yes, MySQL does do Redundancy/Failover. (Ofcourse you must take account of this in your code interacting with the server, but the data will be sync'd). Adam Voigt [EMAIL PROTECTED] On Tue, 2002-06-18 at 08:47, Matt Babineau wrote: Hi All: I quickly skimmed the MySQL manual and didn't see any information on clustering. Does MySQL have any support for clustering or some type of redundant failover systems? Thanks! Matt Babineau Freelance Internet Developer - e: mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] p: 603.943.4237 w: http://www.criticalcode.com/ http://www.criticalcode.com PO BOX 601 Manchester, NH 03105 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] MySQL Clustering, redundancy
I have never actually tried to program against something which talks to multiple DB's, the quickest way would be in your DB connection code to have something that will either: A. Try the first DB and connect to the second if it's down. B. Randomly choose a SQL server. The most fluid solution I could think of would be an application gateway of some sort which will load balance properly to different IP's while in your code you only point to one. Adam Voigt [EMAIL PROTECTED] On Tue, 2002-06-18 at 09:12, Matt Babineau wrote: Thanks for your response Adam! Do you know if there is any way MySQL can be spread across multiple machines? I am looking at a huge application for a client, that will need to support thousands of simultaneous users. I am wondering if MySQL can handle load like that. That's why I was asking about clustering MySQL servers for the ability to handle more users simultaneously. Has anyone had any experience with a large scale application on MySQL? Matt Babineau Freelance Internet Developer - e: [EMAIL PROTECTED] p: 603.943.4237 w: http://www.criticalcode.com PO BOX 601 Manchester, NH 03105 -Original Message- From: Adam Voigt [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 18, 2002 8:55 AM To: [EMAIL PROTECTED] Cc: Matt Babineau Subject: Re: [PHP-DB] MySQL Clustering, redundancy Yes,it's called Replication in the MySQL documentation. However, since the info in the manual is kind of sparse so I would hop on google and do a search for specific instructions on how to do it when your ready, but to answer your question, yes, MySQL does do Redundancy/Failover. (Ofcourse you must take account of this in your code interacting with the server, but the data will be sync'd). Adam Voigt [EMAIL PROTECTED] On Tue, 2002-06-18 at 08:47, Matt Babineau wrote: Hi All: I quickly skimmed the MySQL manual and didn't see any information on clustering. Does MySQL have any support for clustering or some type of redundant failover systems? Thanks! Matt Babineau Freelance Internet Developer - e: mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] p: 603.943.4237 w: http://www.criticalcode.com/ http://www.criticalcode.com PO BOX 601 Manchester, NH 03105 -- 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] Finding highest number in auto increment
SELECT * FROM whatever ORDER BY id DESC; Ofcourse if you want Ascending order, it would be ASC instead of DESC Adam Voigt [EMAIL PROTECTED] On Tue, 09 Apr 2002 15:48:45 +0200, Lisi [EMAIL PROTECTED] wrote: Each record in my table has a unique ID number generated by auto increment each time a new record is added. This is stored in a field called ID. I have a page that displays records as they are selected, but I want the default to be the latest entry if none has been selected. How do I write the query to find the highest number an display that record? It should be something like this I think: SELECT organization FROM ayny WHERE ID ... how does this end? Thanks, -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
Re: [PHP-DB] Finding highest number in auto increment
Oh, forget to include that if you only want that one record, use the LIMIT 1 keyword as well. Adam Voigt [EMAIL PROTECTED] P.S.: All of this is in the MySQL manual. On Tue, 09 Apr 2002 15:48:45 +0200, Lisi [EMAIL PROTECTED] wrote: Each record in my table has a unique ID number generated by auto increment each time a new record is added. This is stored in a field called ID. I have a page that displays records as they are selected, but I want the default to be the latest entry if none has been selected. How do I write the query to find the highest number an display that record? It should be something like this I think: SELECT organization FROM ayny WHERE ID ... how does this end? Thanks, -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
Re: [PHP-DB] New PostgreSQL functions
I'm just curious is the purpose of these functions to remove the requirement that programmers know SQL? I'm not trying to sound sarcastic or anything, but I mean, whats next a pgsql_select_join for joins? If someones smart enough to figure out the Postgres install and performance tuning (and I know my first time was quite a rollercoaster of pain), why would you need to try and simplify it's use when a all powerful, all knowing, all doing pgsql_query would work? I'm mainly just wondering because sometimes my windows counterparts (who write in ASP or iHTML) think it's funny PHP has so many ways to do certain things, and so few ways to do other things. =) Just Curious, Adam Voigt [EMAIL PROTECTED] On Mon, 08 Apr 2002 13:41:46 +0900, Yasuo Ohgaki [EMAIL PROTECTED] wrote: Hi, I've added new PostgreSQL functions to CVS. array pg_metadata(resource db, string table) Get metadata array pg_convert(resource db, string table, array values) Check and convert values for PostgreSQL SQL statement It escapes and add quotes around values accoding to metadata (i.e. Table Definition) bool pg_insert(resource db, string table, array values[, bool convert[, bool async]]) Insert values (field=value) to table bool pg_update(resource db, string table, array fields, array ids[, bool convert[, bool asy nc]]) Update table using values (field=value) and ids (id=value) bool pg_delete(resource db, string table, array ids[, bool convert[, bool async]]) Delete records has ids (id=value) array pg_select(resource db, string table, array ids[, bool convert]) Select records that has ids (id=value) They will be available for PHP 4.3.0. Please refer to test files under ext/pgsql/tests/ for usage. If you use PHP 4.1.x or above, you can replace old PostgreSQL module by new one. There are many new functions that will be avaiable in PHP 4.2.0 also. Bug reports and comments are welcome. Enjoy. -- Yasuo Ohgaki [EMAIL PROTECTED] -- 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: Re: [PHP-DB] New PostgreSQL functions
Well since I've programmed in PHP for a while, I think PHP is quite capable in damn near all of the possible programming areas. But for instance, here are some of their complaints: 1. Weak PHP-Internal Date Manipulation Functions, on certain sites we do quite a bit of non-sql based date manipulation and certain functions which are sql based (and there are functional counterparts for other languages) that are missing from PHP. 2. Weak Error Handling, We could not get the custom error handling to work except when using the trigger_error function, which is useless if an error is caused somewhere theres not an or die(trigger_error()). Essentially what they want is called an error block on iHTML which essentially sends a copy of all errors on that page to a specified email address along with a dump of all the standard arrays like $_POST, and $_GET, and if we could get custom error handling to work, I'm sure we could write this in, but after a week of just trying to get that to work, we were unsuccessful. Also, on some occasions, even with error_reporting set to E_ALL, a missing quote or } would make PHP just show a completely blank white page instead of an error like unterminated function, etc. They also don't like that they have to put or die(mssql_get_last_message()) after every query where in other languages it would automatically stop execution of the page and throw the error the database returned to the page. And just to let you know, you should have seen there eye's light up with glee at me explaining the explode and implode functions, as they were not used to being able to use arrays in situations where they would fit so perfectly, with other languages which handled them clunkily at best. This is just one example of all the positives they found to the PHP language, and I certainly don't want you to think me a ASP zealot because I don't program in ASP or iHTML for that matter, I'm a pure PHP evangelist from top to bottom. Adam Voigt [EMAIL PROTECTED] On Mon, 08 Apr 2002 23:04:25 +0900, Yasuo Ohgaki [EMAIL PROTECTED] wrote: Adam Voigt wrote: think it's funny PHP has so many ways to do certain things, and so few ways to do other things. =) I forgot to ask. May I ask what kind of features/functions are missing? It does not have to be about PostgreSQL module. -- Yasuo Ohgaki -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] mail()
You know that $fromaddress must have the correct header's to, right? Like just [EMAIL PROTECTED] will not be interepreted but something like Reply-to:[EMAIL PROTECTED] will set the Reply-to header correctly. Also, did you try taking out the dynamic values and just entering a hardcoded test without the variables to make sure it works just even with straight static values? Adam Voigt [EMAIL PROTECTED] On Tue, 2 Apr 2002 10:55:20 -0500, James Kupernik [EMAIL PROTECTED] wrote: I'm trying to run a mail function .. the program is running, but I'm not getting the email. Here is the code .. any one have any ideas? $toaddress = $friendemail; $subject = A message from .$fromname..; $mailcontent = Here's a special message from a friend .Your friend, .$fromname. at .$fromemail. writes:\n\n ..$message.; $fromaddress = $fromemail; mail($fromemail, $subject, $mailcontent, $fromaddress); I talked with my ISP and the sendmail_path is set up correctly I know it's not DB related, but I didn't know where else to turn. Thanks for any help you can provide. -- 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: RE: [PHP-DB] mail()
The last parameter of the mail command is for email headers, if you pass in just a single email address it doesn't know what you want to do with that since thats not a valid header. If you don't know what your doing with the last parameter then you don't need to have it, and should omit it, as it is opitional for a reason. If your sure you do need it, you seperate headers like this: To set the reply-to field and the from field (as it would appear to the person who recieves the email), you would do: From:[EMAIL PROTECTED]\nReply-to:[EMAIL PROTECTED] This would make the email appear as coming from [EMAIL PROTECTED], while when they clicked the reply button, it would go to [EMAIL PROTECTED], the most useful situation for these is when your server appends a nastry from address like apache@localhost or whatever from the webserver daemon. Adam Voigt [EMAIL PROTECTED] On Tue, 2 Apr 2002 11:05:09 -0500 , Jamie Kupernik [EMAIL PROTECTED] wrote: I did try taking out the dynamic values and entering static ... Didn't seem to do anything. What do you mean by the Replay-to: thing you said. Can you show me an example that would fit in with mine? Thanks for responding.. James -Original Message- From: Adam Voigt [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 02, 2002 11:02 AM To: James Kupernik Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] mail() You know that $fromaddress must have the correct header's to, right? Like just [EMAIL PROTECTED] will not be interepreted but something like Reply-to:[EMAIL PROTECTED] will set the Reply-to header correctly. Also, did you try taking out the dynamic values and just entering a hardcoded test without the variables to make sure it works just even with straight static values? Adam Voigt [EMAIL PROTECTED] On Tue, 2 Apr 2002 10:55:20 -0500, James Kupernik [EMAIL PROTECTED] wrote: I'm trying to run a mail function .. the program is running, but I'm not getting the email. Here is the code .. any one have any ideas? $toaddress = $friendemail; $subject = A message from .$fromname..; $mailcontent = Here's a special message from a friend .Your friend, .$fromname. at .$fromemail. writes:\n\n ..$message.; $fromaddress = $fromemail; mail($fromemail, $subject, $mailcontent, $fromaddress); I talked with my ISP and the sendmail_path is set up correctly I know it's not DB related, but I didn't know where else to turn. Thanks for any help you can provide. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php This message has been scanned for computer viruses and none were found. Country Curtains Information Systems Department This message has been scanned for computer viruses and none were found. Country Curtains Information Systems Department -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php