[PHP-DB] Not associated with a trusted SQL Server connection
Hi! I am working on a MSSQL DB. As I left last week on friday, everything worked fine, but today I got the error message above... What can be the problem. I think it is something with privileges and user rights, isn't it? Please help, Gabor -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Not associated with a trusted SQL Server connection
I realized that the Authentification in the Properties of the SQL-Server has to be changed to sql-server AND(!) Windows. Is there a way to get it working if I set that to only Windows? Greetings, Gabor --- Hi! I am working on a MSSQL DB. As I left last week on friday, everything worked fine, but today I got the error message above... What can be the problem. I think it is something with privileges and user rights, isn't it? Please help, Gabor -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: extract data from database into an array
Chip Wiegand [EMAIL PROTECTED] wrote 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? This class makes it possible to return an array in two ways very easy. Just try this $db = new Ms_db; $db-connect(true); // open a persistant connection $vars1 = $db-query(SELECT * FROM table); $vars2 = $db-query(SELECT * FROM table,off); $vars1 is now build this way $vars1[row][column] contains the required value... $vars2[column][row] contains the required value... Maybe this helps: ?php /** mySQL - Database Class **/ // Database Configuration Variables (local) // define (DB_SERVER,localhost); define (DB_USER,root); define (DB_PASS,); define (DB_DB,testfaq); class Ms_db { /** * Attributes of this class **/ var $db_result = 0; // Stores the last result_id var $db_id = 0; // Stores the current Database Connection ID var $db_datasets = array(); // Stores the last read database-Set as hash [colum-name][row_number] /** * Connect * @author Marcel Schindler * @param bool $persistant * @return void **/ function connect($persistant = FALSE,$server=DB_SERVER,$user=DB_USER,$pass=DB_PASS,$database=DB_DB) { if (($persistant == FALSE)) { $this-db_id = @mysql_connect($server,$user,$pass) or $this-db_error(Failed to connect to Database-Server,mysql_error()); } else { $this-db_id = @mysql_pconnect($server,$user,$pass) or $this-db_error(Persistant connection failed,mysql_error()); } @mysql_select_db($database) or $this-db_error(Failed to select Database,mysql_error()); } /** * Query * @param SQL-Query * @param flip boolean * @return array $dataset **/ function query($sql,$flipped=on) { $db = $this-db_id; $wert = array(); $count= 0; if (!$db) $this-db_error(Keine Verbindung zur Datenbank); $res = @mysql_query($sql) or $this-db_error(Fehlerhaftes SQL-Statement,$sql.br.mysql_error()); while ($data = mysql_fetch_assoc($res)) { $wert[$count] = $data; $count ; } if ($flipped == on) $wert = $this-reorder_array($wert); $this-db_datasets=$wert; return $wert; } /** * Close - closes the connection to the Database **/ function close() { mysql_close(); } /** * Reorder_array * @param: $array = array(); * @return: $array; **/ function reorder_array($arr) { $wert = array(); // Array ist vom Typ $wert[Zeile][Spalte], soll aber als $wert[Spalte][Zeile] foreach ($arr as $sub) { while (list ($key1,$val1) = each ($sub)) { $wert[$key1][] = $val1; } } $this-db_datasets = $wert; return $wert; } /** * db_error - displays a well-formatted HTML-Page with the error-message * @param string errormessage * @param string mysql-error (optional) **/ function db_error($message,$error='') { echo 'htmlheadtitle'.$message.'/title/headbody bgcolor=#ee'; echo 'table align=center width=600 height=400 bgcolor=#ff'; echo 'trtdh1Error:/h1/td/trtrtd'; highlight_string($message); if ($error!='') { echo 'brbrMySQL said:'.$error; } echo '/td/tr/table/body/html'; die(); } /** * NumRows * Checks the Number of rows affected by the last query * @return integer $number **/ function numrows() { $number = @mysql_num_rows($this-db_result); return $number; } /** * DUMP - just dumps the current array (just for informal purposes * @param VOID **/ function dump() { $x = $this-numrows(); if ($x == 0 ) $this-db_error(There was no query placed before,); echo 'strongQuery DUMP/strongbrtable border=1 cellspacing=0 cellpadding=0 width=100%tr'; $wert = $this-db_datasets; $spalten = array_keys($wert); foreach ($spalten as $values) { $spaltenname[] = $values; echo th bgcolor=\#00\font color=\#ff\$values/font/th; } echo /tr; for ($t = 0; $t = $x; $t ) { if ($t % 2 == 0) echo tr bgcolor=\#dd\; else echo tr bgcolor=\#ee\; foreach($spaltenname as $values) { echo td vAlign=\top\.$wert[$values][$t]./td; }
[PHP-DB] PHP database
Hello I'm to have database, but server's administrator refuses to install MySQL nor PHP MySQL support :( He told me he won't install it and I should use textfiles if I want to have database. I don't want to write engine to textfiles, so... Can You point where can I find PHP code which realize basic database functions without installing any not standard functions nor modules on unix/linux server? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Header problem
Hi All My isp decided to upgrade to 4.2.1 without letting us know? So recoded scripts with new $_VARS in place but one thing refuses to work I have in my script a call to header location. header( Location: ./file.php); Works on my system but not on theirs I have 4.21 also. Is there anything new with header location that I haven't heard of? Any help is most appreciated. Dave C
Re: [PHP-DB] PHP database
Hi, I would try to convince the admin that a DB like MYSql (which is actually part of the standard install under Redhat now) is much more secure than storing data in text files !! HTH Steve At 11:02 AM +0200 15/7/02, Tomator wrote: Hello I'm to have database, but server's administrator refuses to install MySQL nor PHP MySQL support :( He told me he won't install it and I should use textfiles if I want to have database. I don't want to write engine to textfiles, so... Can You point where can I find PHP code which realize basic database functions without installing any not standard functions nor modules on unix/linux server? -- - Minds are like parachutes, they work best when open Support free speech; visit http://www.efa.org.au/ Heads Together Systems Pty Ltd http://www.hts.com.au Email: [EMAIL PROTECTED] Tel: 612 9982 6767 Fax: 612 9981 3081 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] copy a table
What was the SQL that could be run to copy a table, I want to make a duplicate of a table, it just having a different name? Matt Babineau MCWD / CCFD - 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-DB] MSSQL and NT
Hi all! I went after my problem with the NT authentification and I found out, that if you want to make a NT-based Authentification (f.ex for an ODBC-Connection) the I_USR will be seen as the actual user... I granted then rights to the I_USR in the DB, but this way, I cannot distinguish which user is actually working in the DB. IS there a way to use NT-Authentification in connection with php MSSQL ??? Please Help, Gabor -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] copy a table
HI, insert into blabla select * from hohohoho bye, Matt Babineau schrieb: What was the SQL that could be run to copy a table, I want to make a duplicate of a table, it just having a different name? Matt Babineau MCWD / CCFD - 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 -- -- Michael Bretterklieber LCP JAWA Management Software GmbH Liebenauer Hauptstr. 200 A-8041 GRAZ Tel: ++43-(0)316-403274-12 Fax: ++43-(0)316-403274-10 GSM: ++43-(0)676-93 96 698 [EMAIL PROTECTED] homepage: http://www.jawa.at - privat --- E-mail: [EMAIL PROTECTED] homepage: http://www.inode.at/mbretter -- ...the number of UNIX installations has grown to 10, with more expected... - Dennis Ritchie and Ken Thompson, June 1972 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Header problem
on 7/15/02 5:09 AM, Dave Carrera at [EMAIL PROTECTED] appended the following bits to my mbox: I have in my script a call to header location. header( Location: ./file.php); Works on my system but not on theirs Not really database related so it should be on php-general. FWIW, I believe that the location needs to include the scheme and FQDN, i.e., http://example.com/file.php Some browsers (notably Lynx) complain or don't work with relative Location headers. It's also possible that the . is causing a problem. Sincerely, Paul Burney http://paulburney.com/ ?php while ($self != asleep) { $sheep_count++; } ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] load data
Hi to all, I changed Linux from version 7.2 to 7.3 and now when I try to load data using LOAD DATA LOCAL INFILE I got the following error: The used command is not allowed with this MySQL version. I enable --local-infile=1 But I'm still getting the same error. Any help, is greatly appreciate it Thanks in advanced Nato -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Select a subset?
I think the paging function is what you want SELECT * from table limit 0,10 for the first ten records SELECT * from table limit 11,20 for the next ten, etc. Gary Every Sr. UNIX Administrator Ingram Entertainment (615) 287-4876 Pay It Forward mailto:[EMAIL PROTECTED] http://accessingram.com -Original Message- From: Clive Bruton [mailto:[EMAIL PROTECTED]] Sent: Sunday, July 14, 2002 2:50 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Select a subset? I'm just starting to play with PHP and MySQL, kind of getting my head around it, but one thing I'm not getting (right) is delivery of a subset of the found records from MySQL. ie if 100 are found how do I get records 1-10 (or 11-20...). What I have so far is: ?php $db = mysql_connect(host, pass); mysql_select_db(database,$db); ? ... ?php $result = mysql_query(SELECT * FROM table,$db); $num_rows = mysql_num_rows($result); echo $num_rows Rows\n; echo table border=1; echo trtdName/tdtdPosition/tr\n; while ($myrow = mysql_fetch_row($result)) { printf(trtd%s %s/tdtd%s/tr\n, $myrow[1], $myrow[2], $myrow[3]); } echo /table\n; ? However, this delivers all 10,000+ rows on one HTML page. I have worked out how to use LIMIT as an SQL command: $result = mysql_query(SELECT * FROM url LIMIT 10, 10,$db); ie start at record 10 and show the next 10. But this delivers back 10 as the $num_rows variable, when I want the total number of rows. I don't really have to complete two querys to get the appropriate values do I? I'm running PHP 4.2.1 on MacOS X 10.1.4. TIA -- Clive -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] load data
On Monday 15 July 2002 22:03, Natividad Castro wrote: Hi to all, I changed Linux from version 7.2 to 7.3 and now when I try to load data using LOAD DATA LOCAL INFILE I got the following error: The used command is not allowed with this MySQL version. I enable --local-infile=1 But I'm still getting the same error. Any help, is greatly appreciate it You would most likely get better help from the MySQL list. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* A mathematician is a device for turning coffee into theorems. -- P. Erdos */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] copy a table
On Monday 15 July 2002 21:16, Michael Bretterklieber wrote: HI, insert into blabla select * from hohohoho bye, Matt Babineau schrieb: What was the SQL that could be run to copy a table, I want to make a duplicate of a table, it just having a different name? In other words this has nothing to do with PHP and you're better off consulting the manual for your DB or ask on the mailing list relevant to your DB. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* I'm a soldier, not a diplomat. I can only tell the truth. -- Kirk, Errand of Mercy, stardate 3198.9 */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Select a subset?
Adam Alkins wrote at 15/07/02 04:06 mysql_num_rows just counts the amount of rows in a query, so if you only selected 10 rows, it will return 10. If you want to count all the rows in the table, its best to use the COUNT() function SELECT COUNT(*) FROM table In my example, I've selected all rows, ie no search criteria. But let's assume that I have in fact searched for something that returns half the records in the table (5,000 rows). How do I get both the number of rows found (5,000) and get a subset of the records (ie 0-9, 10-19, 20-29...) so that a user can browse through the records rather than getting 5,000 at a time (but still know that a total of 5,000 were found). I hope this makes sense. -- Clive -- 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
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
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
[PHP-DB] MS Access - default value in create table
I can create tables and perform alterations just fine. However, if I try to specify a DEFAULT value in either CREATE TABLE or ALTER TABLE, it craps out on me. For example, this works ALTER TABLE phpbb_mytable ALTER COLUMN LastName TEXT(40) ...but this doesn't ALTER TABLE phpbb_mytable ALTER COLUMN LastName TEXT(40) DEFAULT Unknown ...even though I believe this is the correct syntax. Same thing happens for CREATE TABLE. Help!!! Thanks, -Nuttzy -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] RE: PHP meetup [CROSS-POST] Meet other PHP Developers in Your Area
[snip] No, it's not a dating service :) Want to meet other PHP developers in your area? Check out: http://php.meetup.com/ Pretty nifty idea... especially given the lack of user groups in the U.S. I thought for others who had not seen this I would post this. There is probably already a user group in your area if you live near a major city. According to the PHPusergroups.org web site [http://www.phpusergroups.org/groups.phtml?menu=groups] there 189 PHP user groups in 52 countries. [/snip] I have seen some users groups mentioned, which is outstanding. PHP Meetup is gaining lots of ground with 105 members at last check. Top 5 cities are... Manhattan (below 42nd St) (5 members) London, England (4 members) Ann Arbor, MI (3 members) Melbourne (3 members) Washington DC (3 members) [actually tied with Philadelphia, PA and Orange County, CA] And I finally saw another San Antonio member. Just want to keep this fresh in everyone's mind. If you know of other developer lists where php is discussed please forward this along. Thanks! Jay Do not meddle in the affairs of dragons-for you are crunchy and good with ketchup -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] RE: PHP meetup [CROSS-POST] Meet other PHP Developersin Your Area
Yes, everyone please join up! I would love to find more developers in the Maryland area, and I'm sure others would in their areas as well! Let's do the great american get togeth... err... the great php get together! Martin Clifford Homepage: http://www.completesource.net Developer's Forums: http://www.completesource.net/forums/ Jay Blanchard [EMAIL PROTECTED] 07/15/02 03:20PM [snip] No, it's not a dating service :) Want to meet other PHP developers in your area? Check out: http://php.meetup.com/ Pretty nifty idea... especially given the lack of user groups in the U.S. I thought for others who had not seen this I would post this. There is probably already a user group in your area if you live near a major city. According to the PHPusergroups.org web site [http://www.phpusergroups.org/groups.phtml?menu=groups] there 189 PHP user groups in 52 countries. [/snip] I have seen some users groups mentioned, which is outstanding. PHP Meetup is gaining lots of ground with 105 members at last check. Top 5 cities are... Manhattan (below 42nd St) (5 members) London, England (4 members) Ann Arbor, MI (3 members) Melbourne (3 members) Washington DC (3 members) [actually tied with Philadelphia, PA and Orange County, CA] And I finally saw another San Antonio member. Just want to keep this fresh in everyone's mind. If you know of other developer lists where php is discussed please forward this along. Thanks! Jay Do not meddle in the affairs of dragons-for you are crunchy and good with ketchup -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] header function
Hi, I have a problem with function header(Location:xy.php?var=2). I have not any text (print echo or display any text) at all before I set a cookie If I try to execute this function of Apache server in my Company it is all auf OK. But if I try to run at home I have even the same error Cannot add header information - headers already sent by (output started at C:\httpd\HTDOCS\Auth_user.php on line 3 Can somebody help my I have at home this configuration: I have Winxp OmniHTTPd/2.09 Server. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] header function
What's on line 3 of Auth_user.php ? If you have anything outside of the ?php ... ? tags it will start the html output. Even just an empty line. -steve On Monday, July 15, 2002, at 04:09 PM, Mohammad Forouhar-Fard wrote: Hi, I have a problem with function header(Location:xy.php?var=2). I have not any text (print echo or display any text) at all before I set a cookie If I try to execute this function of Apache server in my Company it is all auf OK. But if I try to run at home I have even the same error Cannot add header information - headers already sent by (output started at C:\httpd\HTDOCS\Auth_user.php on line 3 Can somebody help my I have at home this configuration: I have Winxp OmniHTTPd/2.09 Server. -- 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
AW: [PHP-DB] header function
Nothing it is only header function. No I don't have anything outside. In this case I am connected to the DB. if($v_action ==delete){ $DBquery($cfgDB[data],UPDATE $cfgTbl[accounts] SET acc_service='' WHERE acc_id='$v_id') or die(cannot UPDATE$cfgTbl[accounts]:br.mysql_error()); header(Location: list.php?message='T'); } -Ursprüngliche Nachricht- Von: Steve Cayford [mailto:[EMAIL PROTECTED]] Gesendet: Montag, 15. Juli 2002 23:18 An: Mohammad Forouhar-Fard Cc: [EMAIL PROTECTED] Betreff: Re: [PHP-DB] header function What's on line 3 of Auth_user.php ? If you have anything outside of the ?php ... ? tags it will start the html output. Even just an empty line. -steve On Monday, July 15, 2002, at 04:09 PM, Mohammad Forouhar-Fard wrote: Hi, I have a problem with function header(Location:xy.php?var=2). I have not any text (print echo or display any text) at all before I set a cookie If I try to execute this function of Apache server in my Company it is all OK. But if I try to run at home I have even the same error Cannot add header information - headers already sent by (output started at C:\httpd\HTDOCS\Auth_user.php on line 3 Can somebody help my I have at home this configuration: I have Winxp OmniHTTPd/2.09 Server. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Updating a CLOB-- OCI_INVALID_HANDLE
Hello, Has anyone come across difficulty updating a CLOB in Oracle? I have been able to follow the documentation to insert a new clob by first inserting an EMPTY_CLOB() into the row, and then calling the save method of the OCINewDescriptor/CLOB locator: $conn = OCILogon(username, password, connect_string); $clob_loc = OCINewDescriptor($conn, OCI_D_LOB); $sql = INSERT INTO emp (empno, name, life_story) VALUES (emp_seq.NEXTVAL, :name, EMPTY(CLOB)) RETURNING life_story INTO :clob_loc; $stmt = OCIParse($conn, $sql); OCIBindByName($stmt, :name, $name, -1); OCIBindByName($stmt, :life_story, $clob_loc, -1, OCI_B_CLOB); OCIExecute($stmt, OCI_DEFAULT); $clob_loc-save($new_life_story); However, attempts to SELECT life_story INTO :clob_loc FROM emp WHERE empno = 123 FOR UPDATE have failed. Similarly, UPDATE emp SET name = 'NEW_NAME' WHERE empno = 123 RETURNING life_story INTO :clob_loc have also failed. The error message is the same: Warning: OCILobWrite: OCI_INVALID_HANDLE in /home/acarlos/update.php on line 16. However, if I update the row and set the CLOB column to anything new (including EMPTY_CLOB()), no error occurs. When it fails, I've checked the class of the OCINewDescriptor and it is indeed an object with 6 class methods (as it should be). Has anyone run into this? Is this a bug in PHP's implementation of OCI? Also, is there a limit to the amount of data that can be stored in the CLOB using this method? My uploads have been truncated to a little less than 32K. And I thought using a CLOB was supposed to give me access to 4GB... Thanks for any insight! Anthony Carlos -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP database
Hello I'm to have database, but server's administrator refuses to install MySQL nor PHP MySQL support :( He told me he won't install it and I should use textfiles if I want to have database. Sounds like time too find another hosting provider. Rick -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] PHP4/mssql_query INSERT problems
Why do I keep getting messages like: INSERT INTO OPS (CampaignID,[Description],PhoneInventory,URLInventory) VALUES (463,'In and Out','','') Warning: MS SQL message: Line 1: Incorrect syntax near '463'. (severity 15) in c:\inetpub\wwwroot\intranet2\ccp\campaign_edit.html on line 62 Warning: MS SQL: Query failed in c:\inetpub\wwwroot\intranet2\ccp\campaign_edit.html on line 62 for a simple insert like: $sql2=INSERT INTO OPS (CampaignID,[Description],PhoneInventory,URLInventory) VALUES ($new_campaignid,'$Description','$PhoneInventory','$URLInventory'); echo $sql2; $result=mssql_query($sql2); $error=mssql_query('SELECT ERROR As ErrorCode'); 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
Re: [PHP-DB] PHP4/mssql_query INSERT problems
On Mon, 2002-07-15 at 21:01, Salve Tinkerworth wrote: Why do I keep getting messages like: INSERT INTO OPS (CampaignID,[Description],PhoneInventory,URLInventory) VALUES (463,'In and Out','','') Warning: MS SQL message: Line 1: Incorrect syntax near '463'. (severity 15) in c:\inetpub\wwwroot\intranet2\ccp\campaign_edit.html on line 62 Warning: MS SQL: Query failed in c:\inetpub\wwwroot\intranet2\ccp\campaign_edit.html on line 62 for a simple insert like: $sql2=INSERT INTO OPS (CampaignID,[Description],PhoneInventory,URLInventory) VALUES ($new_campaignid,'$Description','$PhoneInventory','$URLInventory'); Try ('$new_campaignid',) instead snip -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP4/mssql_query INSERT problems
Thanks, I tried that. It results in: INSERT INTO OPS (CampaignID,[Description],PhoneInventory,URLInventory) VALUES ('467','Employee Incentive','','') Warning: MS SQL message: Unclosed quotation mark before the character string '467'. (severity 15) in c:\inetpub\wwwroot\intranet2\ccp\campaign_edit.html on line 62 Warning: MS SQL message: Line 1: Incorrect syntax near '467'. (severity 15) in c:\inetpub\wwwroot\intranet2\ccp\campaign_edit.html on line 62 Warning: MS SQL: Query failed in c:\inetpub\wwwroot\intranet2\ccp\campaign_edit.html on line 62 John Coder [EMAIL PROTECTED] wrote in message 1026782964.2098.1.camel@kaligula">news:1026782964.2098.1.camel@kaligula... On Mon, 2002-07-15 at 21:01, Salve Tinkerworth wrote: Why do I keep getting messages like: INSERT INTO OPS (CampaignID,[Description],PhoneInventory,URLInventory) VALUES (463,'In and Out','','') Warning: MS SQL message: Line 1: Incorrect syntax near '463'. (severity 15) in c:\inetpub\wwwroot\intranet2\ccp\campaign_edit.html on line 62 Warning: MS SQL: Query failed in c:\inetpub\wwwroot\intranet2\ccp\campaign_edit.html on line 62 for a simple insert like: $sql2=INSERT INTO OPS (CampaignID,[Description],PhoneInventory,URLInventory) VALUES ($new_campaignid,'$Description','$PhoneInventory','$URLInventory'); Try ('$new_campaignid',) instead snip -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: PHP4/mssql_query INSERT problems
I updated the mdac drivers on the Win2000 that was running PHP4 on IIS and it seemed to resolve the problem. If anyone has good code for detecting errors after issuing mssql_query please post them. Thanks! Salve Salve Tinkerworth [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Why do I keep getting messages like: INSERT INTO OPS (CampaignID,[Description],PhoneInventory,URLInventory) VALUES (463,'In and Out','','') Warning: MS SQL message: Line 1: Incorrect syntax near '463'. (severity 15) in c:\inetpub\wwwroot\intranet2\ccp\campaign_edit.html on line 62 Warning: MS SQL: Query failed in c:\inetpub\wwwroot\intranet2\ccp\campaign_edit.html on line 62 for a simple insert like: $sql2=INSERT INTO OPS (CampaignID,[Description],PhoneInventory,URLInventory) VALUES ($new_campaignid,'$Description','$PhoneInventory','$URLInventory'); echo $sql2; $result=mssql_query($sql2); $error=mssql_query('SELECT @@ERROR As ErrorCode'); 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