RE: [PHP-DB] Url link
Hi Mark, have a look @ http://www.php.net/manual/en/function.stripslashes.php Greetinx, Mike Michael Rudel - Web-Development, Systemadministration - ___ Suchtreffer AG Bleicherstraße 20 D-78467 Konstanz Germany fon: +49-(0)7531-89207-17 fax: +49-(0)7531-89207-13 e-mail: mailto:[EMAIL PROTECTED] internet: http://www.suchtreffer.de ___ > -Original Message- > From: Mark @ 10base-t.com [mailto:[EMAIL PROTECTED]] > Sent: Monday, May 14, 2001 10:03 PM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] Url link > > > Hey there, > I'm trying to build NEXT/PREV buttons on my search page. > The only way I know to do it so far is via an url. > > So the link I create is the following: > > > http://monster/search1.php?offset=0&submit=submitted&where=his > torical_yn%3D% > 27N%27+and+fname+like+%27%25%25%27+and+lname+like+%27%25%25%27 > +and+dept+like > +%27%2510%25%27+and+locid+like+%27%25%25%27+ > > I'm passing the where= portion as a variable to my query string. > > $query = "select blah from employee where $where order by > blah limit blah" > > But it makes the where section into this: > > select id, lname, fname, extension, locid, email from employee where > historical_yn=\'N\' and fname like \'%%\' and lname like > \'%%\' and dept > like \'%10%\' and locid like \'%%\' order by lname limit 1,20 > > > The problem is it's putting \'s in the where variable and it > makes the query > fail. > > Does anyone know how best to get rid of the \'s or a better way to do > next/prev buttons? > > Thanks!!! > > Mark > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: > [EMAIL PROTECTED] > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Passing variables to/from Flash
I'm trying to send variables to a flash movie... In fact the designer of the flash part of the site told me that ActionScript had a built in function "getData" that had one of its arguments the url from where the data should be pulled out - if he points his function to a *.php page in what form should I output the data within this php script - is it a urlencoded string or can it be an array, or just outputting name-value pairs on separate lines would be enough? Any help will be appreciated. Thanks in advance! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Oracle Database Class
Hello, Neil wrote: > I want to build a site using classes and was wondering is there an Oracle > Database class that I can use instead of writing one from scratch. I don't > want to use abstraction layers. Can aynone direct me to a place where I can > dowload such a class definition? You may want to try Metabase. Among many other things, it lets you for instance retrieve a range of rows of a select query so you can manage large result set and only display or process the part of them that you want. It's sort like using MySQL LIMIT clause but under Oracle. There are several other useful classes based on Metabase that you can use when dealing with databases: Interchanging data between forms and databases http://phpclasses.UpperDesign.com/browse.html/package/231 Query result table display class http://phpclasses.UpperDesign.com/browse.html/package/130 Metabase is freely available and has been downloaded by over 5.300 PHP users from here: http://phpclasses.UpperDesign.com/browse.html/package/20 Manuel Lemos -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] odbc errors
i've just upgraded my computer... running win ME ( i know), PWS and PHP 4.0.5 and access 2000 (odbc) ... the same set up as my last one... i keep getting error msg from scripts that worked only last week on the old setup... the DB is ok as it will connect prepare and execute with no error... but then i get the following msg's Warning: Supplied argument is not a valid ODBC result resource in \include\db1.txt on line 18 which is odbc_result_all($sql_result,"border=1"); nothing to fancy there and the same message Warning: Supplied argument is not a valid ODBC result resource in \include\db1.txt on line 21 which is odbc_free_result ($sql_result); again just a basic action... nothing fancy it's strange as all the other bits of the scripts work with no problems so i think its the ODBC set up. but that is where i step out of the light in to a very dark room and it's driving me nuts...any help or pointers would be cool... MTIA Jello a copy of the whole script is below -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Heterogeneous queries with mssql
Is there a way to set the ANSI_NULLS and ANSI_WARNINGS options when using mssql_connect(), etc., to connect to an MS SQL server database? I'm trying to execute the following query via PHP: select R.Rank, CS.ACCOUNTNO, R.Path from openquery(Resumes, 'SELECT Rank, Path, FileName from SCOPE() where contains(contents, ''unix'') ' ) as R, CONTSUPP as CS WHERE (CS.Address1=R.Path and CS.RecType='L') order by R.Rank Desc Thanks muchly! Gary Pullis Supporting: Sage MAS90/MAS200 | Linux | Windows NT | Novell Netware Office Management Technologies http://www.clwares.com
RE: [PHP-DB] odbc errors
Jello, It appears that your odbc_connect is not happening :) Can you post your code? Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Data Integration Technology Providers > -Original Message- > From: Jello [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, May 15, 2001 11:27 AM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] odbc errors > > > i've just upgraded my computer... running win ME ( i know), PWS and PHP > 4.0.5 and access 2000 (odbc) ... the same set up as my last > one... i keep > getting error msg from scripts that worked only last week on the old > setup... > the DB is ok as it will connect prepare and execute with no error... but > then i get the following msg's > > > Warning: Supplied argument is not a valid ODBC result resource in > \include\db1.txt on line 18 > > which is > odbc_result_all($sql_result,"border=1"); > nothing to fancy there > > and the same message > Warning: Supplied argument is not a valid ODBC result resource in > \include\db1.txt on line 21 > > which is > odbc_free_result ($sql_result); > again just a basic action... nothing fancy > > > it's strange as all the other bits of the scripts work with no > problems so i > think its the ODBC set up. but that is where i step out of the > light in to a > very dark room and it's driving me nuts...any help or pointers would be > cool... > > MTIA > Jello > > a copy of the whole script is below > > > > // connect to system dsn odbc name login and password or die > $connect = odbc_connect("db1","login","pword") or die (" not connected"); > > // create SQL statement > $sql = "SELECT id,code,matchcode FROM products "; > > > // prepare SQL statement > $sql_prepare = odbc_prepare($connect,$sql) or die("Couldn't prepare > query."); > > // execute SQL statement and get results > $sql_result = odbc_execute($sql_prepare) or die("Couldn't execute > statement."); > > > // echo the result in a nice table > odbc_result_all($sql_result,"border=1"); > > // free up resources > odbc_free_result ($sql_result); > > // close connection > odbc_close($connect); > > > > ?> > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] newbie: showing records from SQL
I am a newbie also. Here is the link that got me started (I use MySQL, but I am certain the call tags should be the same, if not, very similar). http://www.webmasterbase.com/article.php?aid=228 A little tutorial ranging from installation notes - creating and entering data - pulling data to webpages. Hope this helps. Marc "Jason Stechschulte" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > On Sat, Apr 28, 2001 at 07:06:31PM +0200, twopeak wrote: > > I managed to find out how to add records in my table, but I can't find out > > how to show records... > > Are there manuals on the web that are specific to php & sql? > > I've found manuals for both, but they both give only a little bit of > > information, and refer to the other website for more information... > > Have you even tried looking yourself?? The page below has many links to > examples, tutorials, and many other useful things. > > http://www.php.net/links.php > -- > Jason Stechschulte > [EMAIL PROTECTED] > -- > The way these things go, there are probably 6 or 8 kludgey ways to do > it, and a better way that involves rethinking something that hasn't > been rethunk yet. > -- Larry Wall in <[EMAIL PROTECTED]> > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Database Name in Metabase (Manuel Lemos)
Hello, I try metabase library. I don't know what I set database name (any database : oracle, postgresql etc) peco -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Closing a frame to facilitate dynamic content
Hi Everyone, I have a question and I know it can be figured out because I did it before but I've since deleted the file and can't remember how I did it...but I'm hoping someone else has done something similar and can help me figure this out again. I have a news service where we reference other sites, we open the URL up into a framed page but would like to give the user the option of closing the top frame and using the other site. Can anyone help? Thanks, Vanessa example of it not working: http://www.distance-educator.com/dn/dn2.phtml?id=4072 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] odbc errors
Jello, You may want to look at some of the user comments on odbc_result_all manual on php.net: http://www.php.net/manual/en/function.odbc-result-all.php Some people mentions errors and fixes there for your problem. I think you are getting connected or you would have got your error messages "Couldn't connect" or "Couldn't execute". That error you are getting is a failure to recognize the function and it's parameters, NOT that you aren't connected. Angie >>> "Jello" <[EMAIL PROTECTED]> 05/15/01 10:27AM >>> i've just upgraded my computer... running win ME ( i know), PWS and PHP 4.0.5 and access 2000 (odbc) ... the same set up as my last one... i keep getting error msg from scripts that worked only last week on the old setup... the DB is ok as it will connect prepare and execute with no error... but then i get the following msg's Warning: Supplied argument is not a valid ODBC result resource in \include\db1.txt on line 18 which is odbc_result_all($sql_result,"border=1"); nothing to fancy there and the same message Warning: Supplied argument is not a valid ODBC result resource in \include\db1.txt on line 21 which is odbc_free_result ($sql_result); again just a basic action... nothing fancy it's strange as all the other bits of the scripts work with no problems so i think its the ODBC set up. but that is where i step out of the light in to a very dark room and it's driving me nuts...any help or pointers would be cool... MTIA Jello a copy of the whole script is below -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] odbc errors
P.S. One of the users there mentions that she had to open the odbc_free_result INTO a variable in order for it to work: $free_result = odbc_free_result($sql_result); for example Angie >>> "Jello" <[EMAIL PROTECTED]> 05/15/01 10:27AM >>> i've just upgraded my computer... running win ME ( i know), PWS and PHP 4.0.5 and access 2000 (odbc) ... the same set up as my last one... i keep getting error msg from scripts that worked only last week on the old setup... the DB is ok as it will connect prepare and execute with no error... but then i get the following msg's Warning: Supplied argument is not a valid ODBC result resource in \include\db1.txt on line 18 which is odbc_result_all($sql_result,"border=1"); nothing to fancy there and the same message Warning: Supplied argument is not a valid ODBC result resource in \include\db1.txt on line 21 which is odbc_free_result ($sql_result); again just a basic action... nothing fancy it's strange as all the other bits of the scripts work with no problems so i think its the ODBC set up. but that is where i step out of the light in to a very dark room and it's driving me nuts...any help or pointers would be cool... MTIA Jello a copy of the whole script is below -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] Passing variables to/from Flash
afaik it's something like: var1=value1&var2=value2&var3=value3... > -Original Message- > From: Atanas Vassilev [mailto:[EMAIL PROTECTED]] > Sent: Dienstag, 15. Mai 2001 12:31 > To: [EMAIL PROTECTED] > Subject: [PHP-DB] Passing variables to/from Flash > > > I'm trying to send variables to a flash movie... In fact the > designer of the > flash part of the site told me that ActionScript had a built in function > "getData" that had one of its arguments the url from where the > data should > be pulled out - if he points his function to a *.php page in what form > should I output the data within this php script - is it a > urlencoded string > or can it be an array, or just outputting name-value pairs on > separate lines > would be enough? > > Any help will be appreciated. > Thanks in advance! > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Database Name in Metabase (Manuel Lemos)
Hello, snpe wrote: > > Hello, > I try metabase library. > I don't know what I set database name (any database : oracle, postgresql etc) Do you mean the database type or the database name? The database type (oracle, postgresql, etc) is set with the "Type" argument of the MetabaseSetupDatabase function. The database name is set with the MetabaseSetDatabase function. Manuel Lemos -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Trying to pull a weeks worth of data of a DATE entry
I am trying to pull a weeks worth of data from MySQL from a DATE var field. Which in turn I can seperate to each days 'entries' sorted by date AND time. Basically trying to set up a page to pull 'news entry date' sorted by date and time, with each day having its own header (like you see on so many websites) and having that header appear only once per days worth of 'news'. Not really sure where to start considering I have only been at this for two days. My scripting skills are limited so far so I am sure that the approach I am taking is the hard way. Can anyone provide me with a link to examples of this code (the actual code) so I can see how it has been done? Or perhaps if its a easy solution (i.e. SELECT date "(from date to date)" type command). I have seen examples of sorting by date and munipulation of the date via SELECT, but cant seem to pinpoint how to extract only from-to dates. Even if I can use a SELECT command where date = x would work. Any help, or pointing in the right direction would be greatly appreciated (and probably save money on my Rogain bills). Thanks, Seriously Confused in Seattle, Marc I have tried multiple attempts at some variation of: $week_var = 7; $tdate = getdate(); $yday_var = $tdate['yday']; $wdate = $yday + $week_var; Granted -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] file() fails to read https
>From 'Mark Cain': >Yes. I am actually getting real content on the non-secure connection. >Yes. The secure connection is really functional on the other server. (I = >can actually cut the above address and paste it into the address bar and = >get the results that I am expecting.) I don't think the standard PHP file functions support HTTP - you may need to use CURL. (Check the appropriate section of the PHP docs) -- Tired of Earthlink? Get JustTheNet! Nationwide Dialup, ISDN, DSL, ATM, Frame Relay, T-1, T-3, and more. EARTHLINK AMNESTY PROGRAM: Buy a year, get two months free More info coming soon to http://JustThe.net, or e-mail me! B!ff: K3wl, w3'v3 r00t3D da [EMAIL PROTECTED] 0h CrAp, INC0M!Ng $%^NO CARRIER -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] MySQL Connect Problem
I have MySQL on a new Win2000 install and can't connect to it using PHP. I am able to connect using the command line. I'm not sure what the next step is to troubleshoot. I've checked the username and password in the .ini file using WinMySQLAdmin. I'm using Apache which is working fine otherwise. Typical code: Thanks. Jeff Oien -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] Trying to pull a weeks worth of data of a DATE entry
Hi Marc, If I understand your question correctly, the SQL Syntax you might want to try would be: SELECT col_1, col_2 FROM table_name WHERE date_col >= $from_date AND date_col <= $to_date Or if you want to get each days results individually, you could do something like this in a loop, where $loop starts at 0 and is incremented and $from_date is the date you wish to start out with: SELECT col_1, col_2 FROM table_name WHERE date_col = DATE_ADD("$from_date", INTERVAL $loop DAY) I'm sure there are at least a dozen other ways to attack this, hopefully these will give you something to work with and are perhaps helpful. Enjoy! Tyrone -Original Message- From: Marc Johnson [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 15, 2001 4:19 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Trying to pull a weeks worth of data of a DATE entry I am trying to pull a weeks worth of data from MySQL from a DATE var field. Which in turn I can seperate to each days 'entries' sorted by date AND time. Basically trying to set up a page to pull 'news entry date' sorted by date and time, with each day having its own header (like you see on so many websites) and having that header appear only once per days worth of 'news'. Not really sure where to start considering I have only been at this for two days. My scripting skills are limited so far so I am sure that the approach I am taking is the hard way. Can anyone provide me with a link to examples of this code (the actual code) so I can see how it has been done? Or perhaps if its a easy solution (i.e. SELECT date "(from date to date)" type command). I have seen examples of sorting by date and munipulation of the date via SELECT, but cant seem to pinpoint how to extract only from-to dates. Even if I can use a SELECT command where date = x would work. Any help, or pointing in the right direction would be greatly appreciated (and probably save money on my Rogain bills). Thanks, Seriously Confused in Seattle, Marc I have tried multiple attempts at some variation of: $week_var = 7; $tdate = getdate(); $yday_var = $tdate['yday']; $wdate = $yday + $week_var; Granted -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Apache+PHP+MSSQL+FreeTDS
Hi, this is the most common subject of this mail list! i am experiencing the same problem. i tried my best reading available archives and experimented the suggestions given in them. my problem still persists :( any help will be greatly appreciated. here is my environment: Apache : 1.3.12 on RH 7.0 PHP: 4.0.5 configured and compiled with the following options: configure --with-apxs=/usr/sbin/apxs --with-sybase=/usr/local/freetds/ FreeTDS: 0.51 configured and compiled with the option: configure --with-tdsver=4.2 --enable-dbmfix MSSQL : 7.0 running on NT 4.0 the /usr/local/freetds/interfaces file contains: alchemy query tcp eather 192.168.23.10 1433 master tcp eather 192.168.23.10 1433 The following code: $conn = mssql_connect( "alchemy", "sa", ""); mssql_select_db( "testdb", $conn); --( Line 6) returns: 0 is not a Sybase link index in /var/www/html/trials/test2.php on line 6 thanks in advance Anil -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] MySQL Connect Problem
Is the MySQL and Apache running on the same machine? Jeff Oien wrote: > I have MySQL on a new Win2000 install and can't connect to it using PHP. > I am able to connect using the command line. I'm not sure what the next > step is to troubleshoot. I've checked the username and password in the > .ini file using WinMySQLAdmin. I'm using Apache which is working fine > otherwise. Typical code: > > $connection = @mysql_connect("localhost", "jeff", "*") > or die("Couldn't connect."); > if ($connection) { > $msg = "success!"; > } > ?> > > Thanks. > Jeff Oien > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] MySQL Connect Problem
Yes they are. Jeff > Is the MySQL and Apache running on the same machine? > > Jeff Oien wrote: > > > I have MySQL on a new Win2000 install and can't connect to it using PHP. > > I am able to connect using the command line. I'm not sure what the next > > step is to troubleshoot. I've checked the username and password in the > > .ini file using WinMySQLAdmin. I'm using Apache which is working fine > > otherwise. Typical code: > > > > > $connection = @mysql_connect("localhost", "jeff", "*") > > or die("Couldn't connect."); > > if ($connection) { > > $msg = "success!"; > > } > > ?> > > > > Thanks. > > Jeff Oien > > > > -- > > PHP Database Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] 'the missing character'
Hi! Does anyone know of a function in php that will take a chunk of text and seperate it into 'chunks' preferably returning it in an array? The reason being is that I have some columns(oracle) that are set to varchar2(4000) and I have text that is 4000+ AND :-) I cannot change it to another format. I was unable to find a chunk maker so I built one. function chunk_maker($text) { // have to count the number of characters, if over 3500 characters need to split into chunks of 3500 characters $count = xcount($text); if($count > 3500) { $chunk_count = $count/3500; //need to clean up the $chunk_count by removing the trailing decimals and //adding one to the total to make sure we do not loose in characters $chunk_count = floor($chunk_count)+1; $i=0; $start=0; while($i != $chunk_count) { // err well this helps to make sure we get the correct amount of characters if($start == 0) { $final = 3500; } else { $final = 3499; } //now we need to make the chunks and stick them in an array $text2[]=substr($text,$start,$final); // err well this helps to make sure we get the correct amount of characters if($start == 0) { $start=1; } $start=$start+3500; $i++; } } else { $text2[] = $text; } return($text2); } function xcount($text) { global $debug; foreach (count_chars($text) as $my_value) $length=$length+$my_value; tracker($length); return($length); } If I just failed to find the right functions please let me know, otherwise please help! :-) Jimmy Brake -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] 'the missing character' YIKES
I forgot to detail the problem, I loose a character every once in a while basically every 3500 characters. Jimmy Brake Cool Tools and Stuff Critical Path Inc. "Making your job easier" -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] MySQL Query structure
Hi people, I was approached by my boss today to construct a page to draw out the data from a recent survey that was conducted via the web. The data is stored in a mysql database by fieldname and the data that the user entered. The problem lies in the way that he wants the page constructed. The page is split into two sections that in essence build the structure of the sql query. At the top of the page there are a number of checkboxes that will both have a variety of fieldnames associated with them. ie if the checkbox is checked then there are a number of fieldnames to be included into the query. These can be checked in any number of ways to include a different query each time. While I can work out a way to do this, the problem comes when I retrieve the results from the database. I set the query to draw out the required information from the database with no problems. However by using a mysql_fetch_row statement I hit a wall. How do I write the statement to reflect the query statement? ie if the query can be: select field1,field2,field3 from database where data = "test" select field4,field5,field6 from databse select field1, field4, field6 from database where data = "test" I think you can see the pattern here. Subsequently the displaying of the results will also be affected in the same way. There is a second area of the form that I can solve by using a different tag, but the same problem will arise here. Any help on this would be greatly appreciated. Thankyou in advance. Shannon -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] 'the missing character'
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Jimmy Brake) wrote: > Does anyone know of a function in php that will take a chunk of text and > seperate it into 'chunks' preferably returning it in an array? > > The reason being is that I have some columns(oracle) that are set to > varchar2(4000) and I have text that is 4000+ AND :-) I cannot change it to > another format. > > I was unable to find a chunk maker so I built one. I'm way tired so may not be reading your code closely enough, but it looks to me like you could do produce the same functionality like this: $breakstring="***BREAK ME HERE!***"; //use whatever you want $inputstring=wordwrap($inputstring, 3500 , $breakstring); $outputarray=explode($breakstring,$inputstring); -- CC -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]