[PHP-DB] case to comment, please
I have the following example case: 1- More than 1000 record in my MySQL database. 2- I have to submit those record via HTTP GET or POST method. 3- I have to read the confirmation message that will be printed on the remote page showing me that the vars have been inserted in the remote database. 4- of course, I have a limitation of executing time of 30 seconds and i should not modify the php.ini i did the following scenario : http://anotherwebserver/url2.php?var1=$var1$var2=$var2&var3=$var3";, "r") ; $data = fread($handle, 11); fclose($handle); if ($data == $var1) return true; else return false; } for ($i=0 ; $i 1-the problem is that the 30 second of execution time expired before i can send even 200 records. 2- in case of not connection of the remote page, and i did not get the $var1 printed ($data == $var1) then i have to re submit this record. Regards -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] connect nativly with Oracle9i
I have php 4.3.4 on windows as a development environments, i could not connect to oracle using the native functions, should i connect using ODBC ?? What will be happen when i will deploy on Linux ? still same ? Nabil -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Multi search function (help)
hi all Is there a way to condition your search: -I have a form for four text boxes for search my Mysql... -I don't want to write 4 conditions and for SQL statements incase he decided not to search with all keywords (fields) - I have by example : name, lastname , nickname and phone form... I need a way to select my records even one or more field were null (searching only on of the above) because the following SQL will generate null result $name=$_POST['naame']; $lastname=$_POST['lastname']; $nickname=$_POST['nickname']; $m_date=$_POST['m_dateY']; echo $name.$lastname.$nickname.$m_date; $sql = mysql_query("SELECT id, name , lastname , m_date from users where name like binary '%$name%' and lastname like binary '%$lastname%' and nickname like binary '%$nickname%' and m_date= YEAR('$m_date') order by id ASC ") or die(mysql_error()); Thanks in advanced -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Multi search function (help)
thanks .. but my question is not for isset... i m thinking consider that i have 10 search fields... if i have to do a combination then i need a day to right the various SQL statements "David Robley" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Nabil wrote: > > > hi all > > > > Is there a way to condition your search: > > > > -I have a form for four text boxes for search my Mysql... > > -I don't want to write 4 conditions and for SQL statements incase he > > decided not to search with all keywords (fields) > > - I have by example : name, lastname , nickname and phone form... > > I need a way to select my records even one or more field were null > > (searching only on of the above) > > > > because the following SQL will generate null result > > > > > > $name=$_POST['naame']; > > $lastname=$_POST['lastname']; > > $nickname=$_POST['nickname']; > > $m_date=$_POST['m_dateY']; > > echo $name.$lastname.$nickname.$m_date; > > > > $sql = mysql_query("SELECT id, name , lastname , m_date from users where > > name like binary '%$name%' and lastname like binary '%$lastname%' and > > nickname like binary '%$nickname%' and m_date= YEAR('$m_date') order by > > id ASC ") or die(mysql_error()); > > > > > > > > Thanks in advanced > > Use isset to test whether the POST values are set and only include in the > query if there is a value. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Drawing table by while
Hiya, How can i draw a new AFTER FIVE in the following loop (i want to echo the records in 5 columns width tables whatever the number of records will be fetched) .. echo ''; while ($myrow = mysql_fetch_array($sql)) { echo $myrow[0]; } echo ''; -- | x | y |z | o | -- |f|q| h| hj | -- . . . -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: Multi search function (help)
yes, this is true, we should add empty() function too. "Ross Honniball" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm not 100% sure, but you may want to also check if the field is empty > (using empty() function) before including in your search. (in addition to > isset) > > Also, just a caution, you will need to take some care in figuring when and > where to place your 'and' statements linking the various parts of the query. > > At 08:01 AM 27/05/2004, you wrote: > >Nabil wrote: > > > > > "David Robley" <[EMAIL PROTECTED]> wrote in message > > > news:[EMAIL PROTECTED] > > >> Nabil wrote: > > >> > > >> > hi all > > >> > > > >> > Is there a way to condition your search: > > >> > > > >> > -I have a form for four text boxes for search my Mysql... > > >> > -I don't want to write 4 conditions and for SQL statements incase he > > >> > decided not to search with all keywords (fields) > > >> > - I have by example : name, lastname , nickname and phone form... > > >> > I need a way to select my records even one or more field were null > > >> > (searching only on of the above) > > >> > > > >> > because the following SQL will generate null result > > >> > > > >> > > > >> > $name=$_POST['naame']; > > >> > $lastname=$_POST['lastname']; > > >> > $nickname=$_POST['nickname']; > > >> > $m_date=$_POST['m_dateY']; > > >> > echo $name.$lastname.$nickname.$m_date; > > >> > > > >> > "SELECT id, name , lastname , m_date from users > > >> > where > > >> > name like binary '%$name%' and lastname like binary '%$lastname%' and > > >> > nickname like binary '%$nickname%' and m_date= YEAR('$m_date') order > > > by > > >> > id ASC ") or die(mysql_error()); > > >> > > > >> > > > >> > > > >> > Thanks in advanced > > >> > > >> Use isset to test whether the POST values are set and only include in the > > >> query if there is a value. > > > > > thanks .. but my question is not for isset... i m thinking consider that i > > > have 10 search fields... if i have to do a combination then i need a day > > > to right the various SQL statements > > > >So do something like: > > > >$query = "SELECT id, name , lastname , m_date from users where 1 "; > >if (isset($_POST['name'])) { > > $query .= "AND name like binary '%{$-POST['name']}%' "; > >} > >if (isset($_POST['lastname'])) { > > $query .= "AND name like binary '%{$_post['lastname']}%' "; > >} > >//etc etc > >$query .= " order by id ASC "; > >$sql = mysql_query($query) or die(mysql_error()); > > > > > >-- > >David Robley > > > >Only cosmetologists give make-up exams. > > > >-- > >PHP Database Mailing List (http://www.php.net/) > >To unsubscribe, visit: http://www.php.net/unsub.php > > . > . Ross Honniball. JCU Bookshop Cairns, Qld, Australia. > . -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] TIMESTAMP -> Y-m-d
Please help me how to print a timestamp string retrived from the database, and print it as -MM-DD Nabil -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] query, INTERVAL problem
usually the mysql convert it to 2003-01-01 type without using this function... especially if it came from a form submission, am i right ? "Nabil" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > ok make it as > > $sql = "SELECT doc_id, exam_date FROM exams WHERE doc_id='$doc_id' and > exam_type_id= '1' and result='PASS' and '$due_date' > (exam_date + INTERVAL > 11 MONTH) "; > > and still have a diffrent records when i use '20030501' than '2003-05-01' > > > > "Jason Wong" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > On Tuesday 27 May 2003 17:03, nabil wrote: > > > No Jason, what I meant that I submit the date value from a form to > MySQL, > > > to execute a query as I said below, and it returns deferent value for > that > > > ... > > > > > > when I send $due_date as '20030501' the query return a different than > > > '2003-05-01' > > > > > > Hope I make clear.. > > > > Nope, still not clear at all. Your query is: > > > > > $sql = "SELECT doc_id FROM exams WHERE doc_id='$doc_id' and > exam_type_id= > > > '1' and result='PASS' and '$due_date' > (exam_date + INTERVAL 11 MONTH) > "; > > > > You're only selecting doc_id. Are you saying that performing the above > query > > doc_id is '2003-05-01' !?! > > > > -- > > Jason Wong -> Gremlins Associates -> www.gremlins.biz > > Open Source Software Systems Integrators > > * Web Design & Hosting * Internet & Intranet Applications Development * > > -- > > Search the list archives before you post > > http://marc.theaimsgroup.com/?l=php-db > > -- > > /* > > Kludge, n.: > > An ill-assorted collection of poorly-matching parts, forming a > > distressing whole. > > -- Jackson Granholm, "Datamation" > > */ > > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] MySQL CONNECTION PROblem
i have the dbconnect.php as : // /// when i put localhost instead of the IP address of my machine (localy) i got the following error... Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in c:\inetpub\wwwroot\kt\superv_list.php on line 5 No Data Found.. what is my problem, this was a test to connect to my database on the same machine . but i replaced the "localhost" with my machine IP address.. do i have to put a domain name instead of an IP if i want to connect to a remote server on the internert? Regards nabil -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] MySQL CONNECTION PROBlem2
Sorry , when i put the IP instead of "localhost " i got the error... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: MySQL CONNECTION PROBlem2
but when i used mysql_error() i got : "sorry database not found" as my dbconnect.php file includes and the user table of mysql database : # # Dumping data for table `user` # INSERT INTO user VALUES ('localhost', 'root', '', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y'); INSERT INTO user VALUES ('%', 'root', '', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'Y', 'N', 'N', 'N'); INSERT INTO user VALUES ('localhost', '', '', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y'); INSERT INTO user VALUES ('%', '', '', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N'); so it has the '%' value so it can be accessed by any host.!!!1 any comment ??? "Cristian Marin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] You don't have the rights to connect to the MySQL server with [EMAIL PROTECTED] You have to add this user to the mysql users table and to allow him to do the needed actions. Also you have to modify the hosts table. -- - Cristian MARIN InterAKT Online (www.interakt.ro) +4021 411 2610 [EMAIL PROTECTED] "Nabil" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Sorry , when i put the IP instead of "localhost " i got the error... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQL CONNECTION PROblem
but when i used mysql_error() i got : "sorry database not found" as my dbconnect.php file includes and the user table of mysql database : # # Dumping data for table `user` # INSERT INTO user VALUES ('localhost', 'root', '', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y'); INSERT INTO user VALUES ('%', 'root', '', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'Y', 'N', 'N', 'N'); INSERT INTO user VALUES ('localhost', '', '', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y'); INSERT INTO user VALUES ('%', '', '', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N'); so it has the '%' value so it can be accessed by any host.!!!1 any comment ??? "John W. Holmes" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > i have the dbconnect.php as : > > // > > > mysql_connect("192.168.0.111" , "root" , "pass") or > > die ("Couldn't connect to database"); > > mysql_select_db("DatabaseName") or > > die("sorry database not found"); > > ?> > > /// > > when i put localhost instead of the IP address of my machine (localy) > i > > got > > the following error... > > > > Warning: mysql_num_rows(): supplied argument is not a valid MySQL > result > > resource in c:\inetpub\wwwroot\kt\superv_list.php on line 5 > > No Data Found.. > > > > what is my problem, this was a test to connect to my database on the > same > > machine . but i replaced the "localhost" with my machine IP address.. > do i > > have to put a domain name instead of an IP if i want to connect to a > > remote > > server on the internert? > > Your query failed. Use mysql_error() to find out why. > > ---John W. Holmes... > > Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E > > 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
Re: [PHP-DB] MySQL CONNECTION PROblem
but when i used mysql_error() i got : "sorry database not found" and i have privileges in mysql/ user table .. as shown below... the point is if i changed 192.168.0.111 to localhost .. i managed to get the data ... as my dbconnect.php file includes and the user table of mysql database : # # Dumping data for table `user` # INSERT INTO user VALUES ('localhost', 'root', '', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y'); INSERT INTO user VALUES ('%', 'root', '', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'Y', 'N', 'N', 'N'); INSERT INTO user VALUES ('localhost', '', '', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y'); INSERT INTO user VALUES ('%', '', '', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N'); "George Patterson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Tue, 10 Jun 2003 16:47:26 +0300 > "nabil" <[EMAIL PROTECTED]> wrote: > > > but when i used mysql_error() i got : "sorry database not found" > > > > as my dbconnect.php file includes > > > > > mysql_connect("192.168.0.111" , "root" , "password") or die("SORRY > > CANNOT CONNECT") ; > > mysql_select_db("kt") or > > die("sorry database not found"); > > ?> > > Nabil, > > Try changing the last line statement to > mysql_select_db("kt") or die("sorry database not found". mysql_error()); > > This will show what the error really is. > > Example, You have created the database haven't you?? > Try using the mysql client to connect from the web server to the mysql > server. > > George Patterson -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Now, how about Roman Numerals?
That's is wonderfull Hugh.. Nabil "Hugh Bothwell" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "David Shugarts" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Second poser today: > > > > How to use either a MySQL select statement or PHP to produce a roman > > numeral, starting from an arabic (INT) number in a database? > > > In PHP: > > > function RomanDigit($dig, $one, $five, $ten) { > switch($dig) { > case 0:return ""; > case 1:return "$one"; > case 2:return "$one$one"; > case 3:return "$one$one$one"; > case 4:return "$one$five"; > case 5:return "$five"; > case 6:return "$five$one"; > case 7:return "$five$one$one"; > case 8:return "$five$one$one$one"; > case 9:return "$one$ten"; > } > } > > function IntToRoman($num) { > if (($num < 1) || ($num > 3999)) > return("No corresponding Roman number!"); > > $m = $num / 1000; > $c = ($num % 1000) / 100; > $x = ($num % 100) / 10; > $i = $num % 10; > > return( > RomanDigit($m, 'M', '', '') > .RomanDigit($c, 'C', 'D', 'M') > .RomanDigit($x, 'X', 'L', 'C') > .RomanDigit($i, 'I', 'V', 'X') > ); > } > > > -- > Hugh Bothwell [EMAIL PROTECTED] Kingston ON Canada > v3.1 GCS/E/AT d- s+: a- C+++ L++>+++$ P+ E- W+++$ N++ K? w++ M PS+ > PE++ Y+ PGP+ t-- 5++ !X R+ tv b DI+++ D-(++) G+ e(++) h-- r- y+ > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] HELP, Still not be able to connect to MySQL
GUYS help me please. 1- mysql server in on my own machine.. 2- my machine IP is 192.168.0.1 3- when i tired to connect as localhost, i managed to query. 4- if i tried to to connect using my IP i got "no database found"... 5- i tried to use mysql_error() ... and it is not an authentication problem as my fresh Mysql sitting point to : # # Dumping data for table `user` # INSERT INTO user VALUES ('localhost', 'root', '', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y'); INSERT INTO user VALUES ('%', 'root', '', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'Y', 'N', 'N', 'N'); INSERT INTO user VALUES ('localhost', '', '', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y'); INSERT INTO user VALUES ('%', '', '', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N'); so it should accept any host.!!! 6- even i tried from other machine on my local network (from 192.168.0.2) i still not be able too... Please help me, am i missing to point to a port number ??? *** all the above is to test how to connect to a remote Mysql server online... Nabil -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] HELP, MSSQL STORED PROCEDURES
PLEASE HELP ME PHP PEOPLE, I have a stored procedure on a remote Microsoft (stupid) SQL server.. and I have to connect to it remotely and I have only permission to execute those specific procedure , and I only got the returned value... My server that I will connect from is Linux, apache with MySQL database, and my code ofcourse PHP How can i connect to microsoft SQL server from my php linux server..??? i think ODBC is not excisted in Linux... ( I reserve to myself to be wrong)... Please help me if I can , how can I connect to that server , and execute them, and get the return values... One of the stored procedures that i got a copy from the remote administrator is : Waiting for any comment / --== === CREATE PROCEDURE ChangePasswd @login varchar(32) , @oldpass varchar(16), @newpass varchar(16) AS declare @chkpass int set @chkpass = (select count(*) from subaccounts where [EMAIL PROTECTED] and [EMAIL PROTECTED]) if @chkpass<>0 begin update subaccounts set [EMAIL PROTECTED] where [EMAIL PROTECTED] and [EMAIL PROTECTED] select '0' as err end else begin select '1' as err end Go --== === -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] HELP, MSSQL STORED PROCEDURES
could you help for that .?? "Martin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > You are entirely wrong about ODBC. Linux has several implementations available. > > > On Sat, 14 Jun 2003 14:30:42 +0300 > "nabil" <[EMAIL PROTECTED]> wrote: > > > PLEASE HELP ME PHP PEOPLE, > > > > I have a stored procedure on a remote Microsoft (stupid) SQL server.. > > and I have to connect to it remotely and I have only permission to execute > > those specific procedure , and I only got the returned value... > > > > My server that I will connect from is Linux, apache with MySQL database, and > > my code ofcourse PHP > > How can i connect to microsoft SQL server from my php linux server..??? i > > think ODBC is not excisted in Linux... > > ( I reserve to myself to be wrong)... > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: php_mssql.dll
go and download a new version ... then change the extention dir in php.ini , restart ur IIS and then BINGO "Louai" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I got the following error when I tried to connect to MS SQL server: > > Unknown () mssql: unable to initialize module > > Please advise > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Displaying 10 records per page
check this out :)) http://www.phpfreaks.com/print.php?cmd=tutorial&tut_id=43 Nabil "David" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Dear All > > I am writing a support pages for my company at present. I would like to > display 10 records per page, e.g. like google does it, and if there are more > than 10 then a next | previous button appears at the bottom. Has anybody > have experience of this and be able to give me some ideas, e.g. using an > array to store the MySQL query or a query straight from MySql, etc ... > > Thank you for any help > > David > Anagram Systems > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] PLS Advise, Highlighted Text from a Query
Dear all, 1- I have a form with an input text : keyword 2- the field address is in my MySQL as TEXT field. 3- I select * from db where address like '%keyword%' 4- I want when echo the return $row["address"] to highlight the entered keyword (that the user has entered in the search form) in the output with a different font backcolor or by just another color... to let the user see what he was searching for 5- and if it possible to echo how accurate (percentage) the return rows has fit his search... Please Advise how to do it... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: PLS Advise, Highlighted Text from a Query
Yes please that is what i want.. if it possible to give em the code.. thanks in advance for you and for George Pitcher "Cristian Marin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Yes it is posible using the preg_replace substituing the text with the > text or to what ever you want. > > If you are not advanced in php you could do it with substr_replace() > function. > > The first solution is more dificult to be used but you have the advantage > you can search for each word used in the %search_words% and highlight them > even if they are not positioned in the same order in the text searched. (But > in this case you have to use the MySQL 'match against' with the full text > indexing in place of like). > > The result is something like this: http://www.interakt.ro/search.php. Try > searching 'mysql adodb' > > If this is what you want I can help you with a code block > > > > -- > - > Cristian MARIN - Developer > InterAKT Online (www.interakt.ro) > Tel: +4021 312.53.12 > Tel/Fax: +4021 312.51.91 > [EMAIL PROTECTED] > "Nabil" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Dear all, > > > > 1- I have a form with an input text : keyword > > 2- the field address is in my MySQL as TEXT field. > > 3- I select * from db where address like '%keyword%' > > 4- I want when echo the return $row["address"] to highlight the entered > > keyword (that the user has entered in the search form) in the output with > a > > different font backcolor or by just another color... to let the user see > > what he was searching for > > 5- and if it possible to echo how accurate (percentage) the return rows > has > > fit his search... > > > > Please Advise how to do it... > > > > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: PLS Advise, Highlighted Text from a Query
Edward , what about the percentage how much accurate the result returned?? "Becoming Digital" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Oops! I sent this to the wrong list last night. This is what happens when > we answer emails @ 4:18 AM... > > > 4- I want when echo the return $row["address"] to highlight the entered > > keyword (that the user has entered in the search form) in the output with a > > different font backcolor or by just another color... to let the user see > > what he was searching for > > $length = strlen( $keyword ); > $position = strpos( $row["address"], $keyword ); > $row["address"] = substr_replace( $row["address"], > "$keyword, > $position, > $length ); > ?> > > You must specify 'yourclass' in a stylesheet, obviously. While this is not > nearly as eloquent as Cristian's suggested use of regular expressions, it seems > better suited to your level of experience. As they say, if you need to ask... > > Edward Dudlik > Becoming Digital > www.becomingdigital.com > > > - Original Message - > From: "nabil" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Wednesday, 18 June, 2003 10:11 > Subject: [PHP-DB] Re: PLS Advise, Highlighted Text from a Query > > > Yes please that is what i want.. if it possible to give em the code.. > thanks in advance for you and for George Pitcher > > > "Cristian Marin" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Yes it is posible using the preg_replace substituing the text with the > > text or to what ever you want. > > > > If you are not advanced in php you could do it with substr_replace() > > function. > > > > The first solution is more dificult to be used but you have the advantage > > you can search for each word used in the %search_words% and highlight them > > even if they are not positioned in the same order in the text searched. > (But > > in this case you have to use the MySQL 'match against' with the full text > > indexing in place of like). > > > > The result is something like this: http://www.interakt.ro/search.php. Try > > searching 'mysql adodb' > > > > If this is what you want I can help you with a code block > > > > > > > > -- > > - > > Cristian MARIN - Developer > > InterAKT Online (www.interakt.ro) > > Tel: +4021 312.53.12 > > Tel/Fax: +4021 312.51.91 > > [EMAIL PROTECTED] > > "Nabil" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > Dear all, > > > > > > 1- I have a form with an input text : keyword > > > 2- the field address is in my MySQL as TEXT field. > > > 3- I select * from db where address like '%keyword%' > > > 4- I want when echo the return $row["address"] to highlight the entered > > > keyword (that the user has entered in the search form) in the output > with > > a > > > different font backcolor or by just another color... to let the user see > > > what he was searching for > > > 5- and if it possible to echo how accurate (percentage) the return rows > > has > > > fit his search... > > > > > > Please Advise how to do it... > > > > > > > > > > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: PLS Advise, Highlighted Text from a Query
thanks so much for your help , but would help me more to implement the example : $query = "open source world, open mind for all"; $text = "open"; . . $count = 0; $keywords = (split $query into array of whole words); for (each word in $query) { $n = (number of times $word found in $text); $count += (length of $word) * (1 + strength($n)); } $score = ($count + $count) / (length of $query + length of $text ); $score = curve($score); Nabil "Mikon Dosogne" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > [...] > > what about the percentage how much accurate the result returned?? > > I'm not sure what kind of keywords or text you're searching, but here's > the algorithm i used a while back, for plain-text search: > > given: > $query > $text > > /* > curve() maps values between 0 and 1 to.. a curve: >0% -> 0% > 25% -> 43% > 50% -> 75% > 75% -> 93% > 100% -> 100% > */ > function curve($x){ >$x = 1 - $x; >$x = $x * $x; >return 1 - $x; > } > > /* > given a number between 0 and +INFINITY, > strength returns a value between 0 and 1 (0% and 100%) > the higher $n is, the closer to 1 the result. > 0 -> 0% 6 -> 85.7% > 1 -> 50% 7 -> 87.5% > 2 -> 66.6% 8 -> 88.8% > 3 -> 75% 9 -> 90% > 4 -> 80% 19 -> 95% > 5 -> 83.3% 100 -> 99% > */ > function strength($x){ >return ($x / ($x + 1)) > } > > $count = 0 > $keywords = (split $query into array of whole words) > for (each word in $query) { >$n = (number of times $word found in $text); >// add the size of $word to $count, or more depending on $n >$count += (length of $word) * (1 + strength($n)); > } > $score = ($count + $count) / (length of $query + length of $text ); > $score = curve($score); // repeat a few times if needed, to get decent > scores > > and there you have it. > > - > mikon > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Header, Directory, and SESSIONs
Hi all, wish u all a good weekend.. Guys I have a question as the following: 1- In my wwwroot I have two folders : folder1 and folder2 (actually I have 14 folders) 2- In the same two folders there are same PHP files do the same job, as db jobs with different databases.. 3- I log in the users by register a session, lab lab lab ... etc 4- the logging files in the two folders are different by registering a different session value. 4- I want if any user jumped to the other directory and logged in with the correct requested password TO HAVE THE FIRST SESSION UNREGISTERED automatically, so he can't be logged in in both at same time.. and keep only the new.. and ofcourse have to re logging if he jumped back to the first one... (the reason that every folder has different DB connection, and the interface of the two section are identical.. so I need to split it .to avoid any problems with many users ) 5- what I m trying to do is , if there is a possibility to control the header.. by if { /folder1 go } else { unregister session whatever} if {/ folder2 .. } else {.} etc 6- IS IT A GOOD WAY TO DO IT , OR NOT? of cource I need a security in the first place.. I HOPE I WAS CLEAR, and thanks for your patient again... :)) (sorry because it might be shouldn't in db list) Regards Nabil -- ""open source world, open mind for all"" -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] mysql_bind question
Any one give me an idea , I have a procedure in Microsoft SQL server return : select 0 as err, @cardPrice as cardPrice, @newBalance as newBalance, @exp as expirationDate I want to print out the return vars as @cardPrice ,,, please note that I got the $row[0] as 0 but not the $row[1] or $row["cardPrice "]... is it a bind problem ? -- ""open source world, open mind for all"" -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] MySQL Backup, final script !!!
I have been searching inside the mailing lists regarding the a PHP code that dump all or a selected databases from MySQL ... and haven't managed to get a script like PhpMyAdmin does... please any ready script or idea ... backup.sql"); ?> //Because it didn't work with me (on windows by example). All what I am thinking to do is a script that retrieved the database names then retrieve the tables names, then fields names and dump the data in an schema like mysqldump does any suggestions?? Cheers... Nabil -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQL Backup, final script !!!
thanks a lot for your response but i got Fatal error: Call to a member function on a non-object in c:\inetpub\wwwroot\dump.php on line 3 not that mysql is 3.23.53 my script is : / query($sql); while ($row = $db -> fetchRow ('DB_GETMODE_NUM') ) { $sql = ' BACKUP TABLE '.$row[0].' TO "/db_backup" '; $db->query($sql); } ?> / "Armand Turpel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > You have only to modify it to your environement > It works with mysql >= 3.23.52 > > // Get all table names of the database > // > $sql = ' > SHOW TABLES > FROM >test_db > ; > $db->query($sql); > > > while($row = $db->fetchRow( 'DB_GETMODE_NUM')) > { > > $sql = ' > BACKUP TABLE > '.$row[0].' > TO > "/db_backup" > '; > $db->query($sql); > } > > Armand > > > > Nabil wrote: > > >I have been searching inside the mailing lists regarding the a PHP code that > >dump all or a selected databases from MySQL ... > >and haven't managed to get a script like PhpMyAdmin does... please any ready > >script or idea ... > > > > backup.sql"); ?> > >//Because it didn't work with me (on windows by example). > > > >All what I am thinking to do is a script that retrieved the database names > >then retrieve the tables names, then fields names and dump the data in an > >schema like mysqldump does > > > >any suggestions?? > > > >Cheers... > >Nabil > > > > > > > > > > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQL Backup, final script !!!
thnks, i will give it a shot "Armand Turpel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I use an db abstraction class. You have to replace this by yours. Of > course you got a "Fatal error: Call to a member function on a > non-object" because such an object dosen't exist in your script. First > you have to connect to a database using mysql_connect() and using > mysql_query and mysql_fetch_row. > > Armand > > Nabil wrote: > > >thanks a lot for your response but i got > > > >Fatal error: Call to a member function on a non-object in > >c:\inetpub\wwwroot\dump.php on line 3 > >not that mysql is 3.23.53 > > > >my script is : > >/ > > >$sql = 'SHOW TABLES FROM chat'; > >$db->query($sql); > >while ($row = $db -> fetchRow ('DB_GETMODE_NUM') ) > >{ > >$sql = ' BACKUP TABLE '.$row[0].' TO "/db_backup" '; > >$db->query($sql); > >} > >?> > >/ > > > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] HELP PLEEASSSEE
I have a form like: . . while($row = mysql_fetch_array($result)) { ?> > http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] non-GPL MySQL licenses & PHP5
As i read in www.MySQL.com: The software from MySQL AB that you can download from the pages listed below, is licensed under the GNU General Public License (GPL) and is provided "as is" and is without any warranty. You need to purchase commercial non-GPL MySQL licenses: a.. If you distribute MySQL Software with your non open source software, b.. If you want warranty from MySQL AB for the MySQL software, c.. If you want to support MySQL development. So Why it is not supported with PHP5? and from where i can get the lib?? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] XML to MySQL
Dear All ; I have an XML files like the following and i want to make an PHP code to insert it into my MySQL how can i read the nodes ot tages??? by the way i can export like this file from PhpMyAdmin but i cann't dump it back... Thanks in advance Nabil - - - 1 Mark Smith company1 123456 city1 first street 12 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Testing code
run the mysqld on shell "Hugh Dickinson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Is it possible to test PHP and MySQL scripts and databases without being registered on a web server? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Any one can help me dump XML into MySQL??
Dear All ; I have an XML files like the following and i want to make an PHP code to insert it into my MySQL how can i read the nodes ot tages??? by the way i can export like this file from PhpMyAdmin but i cann't dump it back... Thanks in advance Nabil - - - 1 Mark Smith company1 123456 city1 first street 12 - -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: XML to MySQL
any one ?? "Nabil" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Dear All ; > > I have an XML files like the following and i want to make an PHP code to > insert it into my MySQL > how can i read the nodes ot tages??? by the way i can export like this file > from PhpMyAdmin but i cann't dump it back... > Thanks in advance > Nabil > > > - > - > - > 1 > Mark > Smith > company1 > 123456 > city1 > first street > 12 > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] any Help !! the only way have to ODBC to Linux
I have an Linux server running Apache/PHP/MySQL. and I need to connect to another server running MSSQL server 7 THE POINT IS the only way I have to connect is throu ODBC connection because the network administrator only allowed me to connect thru port 1433 that ODBC uses.. I tried to make it direct connection, but this way uses many ports that the firewall won't allowed.. He said for security reasons that he can't open those ports to prevents hackers to use them ... do u think this is a true ? any advice what port the direct connection uses??? does it uses NetBIOS? if he was right ... so I have to change to ODBC I heard about FreeDTS and iODBC, but I need some advice and notes to make it easy for me.. Please HELP.. and your valuable comments will be appreciated.. Nabil -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: ./configure stupidity
please please would you help me to get mysql - gd - iodbc (odbc) - mssql - apache I need to upgrade because i need the new one with iodbc support not unixODBC. and i need it with ofcourse ( mysql - gd - iodbc (odbc) - mssql - apache ) I have read so many articles all over the web, and i reffered to php.net ... MY PROBLEM is that i m new to linux and when it come to specify the DIR , i got lost... and when i make the ./configure , then make then make install ,, i got errors always .., i untared the file in /usr/local/src and after everything done , i echo phpinfo() and i got the version still there !!! I installed RedHat 7.3 ... the current php that came with redhat is perfectly working just i need to make mssql and iodbc work... so if there any other way please help me.. Please help me in details "Cristian Marin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I think it's very good as it is. ./configure actually is almost a standard > for every compilation and is not ment to be used by a programmer but by a > system admins. Linux is not Windows. If you really want to learn to compile > a php create in a day or two a complete line with everything you ever think > you need about php or compile them as modules, save the config line in a > file and keep it on a CD. From version to version are very few changes to > the ./configure options. > > -- > - > Cristian MARIN - Developer > InterAKT Online (www.interakt.ro) > Tel: +4021 312.53.12 > Tel/Fax: +4021 312.51.91 > [EMAIL PROTECTED] > "Nico Sabbi" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > > > Hi, > > > > I wonder why at compile time ./configure doesn't automatically detect > what > > features are compilable and what not, so as to > > build in php as much as possible. > > > > There isn't even such an option available, with the result that everytime > I > > recompile PHP I end-up missing some group of functions > > that I didn't expect to need. > > > > > > > > Thanks, > > Nico > > > > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] ANYONE KNOWS, can help me to link Linux to MS SQLserver 7 by ODBC
Hiya all; I have been trying so hard to get that done.. and i posted many here. but with no hope.. here is a summury of what i did: - I tried FreeTDS as a driver with unixODBC ... - Tried to remove mysql- apache - php and recomplied them with : iodbc - Tried to try openlink driver. - tried to upgrade from redhat 7.3 to 9 as i faced do much problem with gcc compiler when i compiled php and apache.. All the above with no hope so finaly , i formated the system then i installed a clean RedHat 9 with apache and php 4.2.2 and when i echo phpinfo() i got the following BUT WHAT IS dbx and there is Micrososft SQL server and when i call odbc_connect ... i got Warning: SQL error: [unixODBC][Driver Manager]Data source name not found, and no default driver specified, SQL state IM002 in SQLConnect in /var/www/html/louai.php on line 11 if my work was right .. how can i link the driver (FreeTDS and then the DSN..) / PHP Version 4.2.2 System Linux sylvester.devel.redhat.com 2.4.20-2.41smp #1 SMP Sun Feb 9 09:29:47 EST 2003 i686 athlon i386 GNU/Linux Build Date Feb 25 2003 09:44:31 Configure Command './configure' '--host=i386-redhat-linux' '--build=i386-redhat-linux' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-db3' '--with-curl' '--with-dom=/usr' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-ttf' '--with-gdbm' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-regex=system' '--with-xml' '--with-expat-dir=/usr' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-discard-path' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--without-oci8' '--with-pear=/usr/share/pear' '--with-imap=shared' '--with-imap-ssl' '--with-kerberos=/usr/kerberos' '--with-ldap=shared' '--with-mysql=shared,/usr' '--with-pgsql=shared' '--with-snmp=shared,/usr' '--with-snmp=shared' '--enable-ucd-snmp-hack' '--with-unixODBC=shared' '--enable-memory-limit' '--enable-bcmath' '--enable-shmop' '--enable-versioning' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mcal' '--with-apxs2=/usr/sbin/apxs' Server API Apache 2.0 Filter Virtual Directory Support disabled Configuration File (php.ini) Path /etc/php.ini Scan this dir for additional .ini files /etc/php.d additional .ini files parsed /etc/php.d/imap.ini, /etc/php.d/ldap.ini, /etc/php.d/mysql.ini, /etc/php.d/odbc.ini Debug Build no Thread Safety disabled This program makes use of the Zend Scripting Language Engine: Zend Engine v1.2.0, Copyright (c) 1998-2002 Zend Technologies PHP 4 Credits Configuration PHP Core Directive Local Value Master Value allow_call_time_pass_reference On On allow_url_fopen 1 1 always_populate_raw_post_data 0 0 arg_separator.input & & arg_separator.output & & asp_tags Off Off auto_append_file no value no value auto_prepend_file no value no value browscap no value no value default_charset no value no value default_mimetype text/html text/html define_syslog_variables Off Off disable_functions no value no value display_errors On On display_startup_errors Off Off doc_root no value no value enable_dl On On error_append_string no value no value error_log no value no value error_prepend_string no value no value error_reporting 2039 2039 expose_php On On extension_dir /usr/lib/php4 /usr/lib/php4 file_uploads 1 1 gpc_order GPC GPC highlight.bg #FF #FF highlight.comment #FF9900 #FF9900 highlight.default #CC #CC highlight.html #00 #00 highlight.keyword #006600 #006600 highlight.string #CC #CC html_errors On On ignore_user_abort Off Off im
Re: [PHP-DB] ANYONE KNOWS, can help me to link Linux to MS SQLserver 7 by ODBC
Hi Jason; i appreciate your help always ... Please Jason help me to do this The sql server is on 192.168.0.101 IP address. Please give me a sample of how can i config these files : "/etc/odbc.ini" &"/etc/odbcinst.ini" Should i add any entry to freetds.conf ... and can you tell me what is the .so file that works with MS SQL7 that i should point to. Nabil "Jason Wong" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Monday 28 July 2003 16:38, Nabil wrote: > > > I have been trying so hard to get that done.. and i posted many here. but > > with no hope.. here is a summury of what i did: > > > > - I tried FreeTDS as a driver with unixODBC ... > > - Tried to remove mysql- apache - php and recomplied them with : iodbc > > - Tried to try openlink driver. > > - tried to upgrade from redhat 7.3 to 9 as i faced do much problem with > > gcc compiler when i compiled php and apache.. > > > > All the above with no hope > > so finaly , i formated the system then i installed a clean RedHat 9 with > > apache and php 4.2.2 and when i echo phpinfo() i got the following > > > > BUT WHAT IS dbx and there is Micrososft SQL server > > > > and when i call odbc_connect ... i got Warning: SQL error: > > [unixODBC][Driver Manager]Data source name not found, and no default driver > > specified, SQL state IM002 in SQLConnect in /var/www/html/louai.php on line > > 11 > > if my work was right .. how can i link the driver (FreeTDS and then the > > DSN..) > > Have you configured > > /etc/odbc.ini > /etc/odbcinst.ini > > correctly? > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.biz > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > -- > Search the list archives before you post > http://marc.theaimsgroup.com/?l=php-db > -- > /* > He who slings mud generally loses ground. > -- Adlai Stevenson > */ > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] ANYONE KNOWS, can help me to link Linux to MS SQLserver 7 by ODBC
these are not working because i need to connect ro Micro$oft SQL server 7 NOT to mysql nor postgresql "Jason Wong" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Monday 28 July 2003 18:13, Nabil wrote: > > > Please Jason help me to do this The sql server is on 192.168.0.101 IP > > address. > > > > Please give me a sample of how can i config these files : "/etc/odbc.ini" > > &"/etc/odbcinst.ini" > > As an example my /etc/odbc.ini contains: > > [MySQL-test] > Description = MySQL database test > Driver = MySQL > Server = localhost > Database= test > Port = 3306 > Socket = > Option = > Stmt = > > and /etc/odbcinst.ini contains > > [PostgreSQL] > Description = ODBC for PostgreSQL > Driver = /usr/lib/libodbcpsql.so.2 > Setup = /usr/lib/libodbcpsqlS.so.1 > FileUsage = 1 > > [MySQL] > Description = ODBC Driver for MySQL > Driver = /usr/lib/libmyodbc.so.2 > Setup = /usr/lib/libodbcmyS.so.1 > FileUsate= 1 > CPTimeout= > CPReuse = > > Best refer to the unixODBC docs for more info. > > > Should i add any entry to freetds.conf ... and can you tell me what is the > > .so file that works with MS SQL7 that i should point to. > > No idea, never used freetds before. > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.biz > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > -- > Search the list archives before you post > http://marc.theaimsgroup.com/?l=php-db > -- > /* > Children are like cats, they can tell when you don't like them. That's > when they come over and violate your body space. > */ > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] [unixODBC]Client unable to establish connection
I got the follwing error when i try to use isql -v or in my php code thet looks like $hh= odbc_connect('DSNname','user','password') or die(odbc_error()); [unixODBC]Client unable to establish connection [ISQL]ERROR: Could not SQLDriverConnect I have FreeTDS compiled --with-unixodbc and i tested the connection : bash> tsql DSNname -S 192.168.0.1 -U user -P pass and i got connected... and i tried telnet 192.168.0.1 1433 and i managed too SO what do u think the prblem is? -- Nabil Attar Advanced Web Solutions /*** Everyone is a beginner once, and no one is an expert at everything. ***/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: mySQL Binaries for Linux
You just untar it and copy it to a directory like /ur/local/mysql then copy php.ini to /etc you read the read me that is in the same directory shell> groupadd mysql shell> useradd -g mysql mysql shell> cd /usr/local shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf - shell> ln -s full-path-to-mysql-VERSION-OS mysql shell> cd mysql shell> scripts/mysql_install_db shell> chown -R root . shell> chown -R mysql data shell> chgrp -R mysql . shell> bin/safe_mysqld --user=mysql & or shell> bin/mysqld_safe --user=mysql & if you are running MySQL 4.x "John Ryan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I downloaded what I thought was Linux mySQL binaries, and the INSTALL file > said there should be a bin directory when I untar, but there isnt! Just a > BUILD folder and loads of make files. > > Did I download the wrong one? > I downloaded mysql-standard-4.0.14-pc-linux-i686.tar.gz -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: PHP connection to remote Access database on NT
Yes , and I done myself to mssql on windows from linux/apache you have to use odbc .. use FreeTDS , it is free and open soured... and work like a charm Nabil "John Almberg" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Here's a question I hoped I'd never have to ask... > > Is it possible for PHP, running on a Linux/Apache webserver, to connect > to an Access database running on a remote NT box? The NT box is a back > office server behind a firewall. > > In a nutshell, the customer wants his website to be able to record > on-line sales in his Access-based Point of Sale system. The POS system > will be running simultaneously. > > I haven't done much work with Access, but my impression is that it locks > tables and there might be some difficulties sharing write access to the > data, but I could be wrong about this. > > Is there any way Access can be stretched to do this kind of thing? > > Thanks. > > -- John -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: backing up MySQL
use the following script ## #!/bin/sh # Create the temporary copy directory mkdir /tmp/mysql # Get the list of MySQL Databases & copy them for var in `find /var/lib/mysql/ -type d | \ sed -e "s/\/var\/lib\/mysql\///"`; do mysqlhotcopy -q "$var" /tmp/mysql done # Tar/gzip data date=`date -I` tar czf /tmp/mysql-$date.tar.gz -C /tmp/ mysql/ # or use : mysqldump command -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Compiling 4.2.3 with MySQL ... what does it look for?
Hi if you compiled apache with prefix /usr/local/apache (i use apache_1.3.28.tar) and you put your mysql binary into /usr/local/mysql (i use mysql-standard-4.0.14-pc-linux-i686.tar) then you configure php (i use php-4.3.2.tar ) ./configure --prefix=/usr/local/php --with-config-file-path=/etc --with-apxs=/usr/local/apache/bin/apxs --enable-debug=no --enable-safe=mode --with-mysql=/usr/local/mysql --with-exec-dir=/usr/bin --with-regex=system I've used these combinations on a very heavy production server , and they work like a charm.. if you need any further assistance please email me back Nabil "-{ Rene Brehmer }-" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > X-posted to PHP General, PHP DB, and MySQL > > Hi gang > > Attempting to get my Linux test-server working, but ran into a problem when > "making" PHP... > > System is RedHat 8, Apache 1.3.27 (compiled myself, tested OK), MySQL 4.0.13. > > The Apache 2.0.40 and PHP 4.2.2 that came w. RH8 didn't work correctly, > thus I've ventured into my own creation. > > Trying to build PHP 4.2.3 (because that's what my webhost runs, so need > that version to test correctly) w. support for MySQL. Running > > ./configure --with-mysql=/[path to mysql] --with-apxs=/[path to apxs] > > Found the path to the apxs to be /usr/local/apache/bin/apxs, but for the > life of me I cannot figure out what path to give it for MySQL. I installed > MySQL from the the RPM files: > MySQL-client-4.0.13-0.i386.rpm > MySQL-devel-4.0.13-0.i386.rpm > MySQL-embedded-4.0.13-0.i386.rpm > MySQL-server-4.0.13-0.i386.rpm > MySQL-shared-4.0.13-0.i386.rpm > > client and server first, the rest second ... used --force to get them in, > because it complained about version issues with the one already there (even > though the package manager was told not to put the Mysql in, it still put > MySQL 3.something in...) > > When doing the configure above, I get this error: > > configure: error: Cannot find header files under /usr/include > > or whatever path I give it ... I'm having a hard time figuring out where > the RPM puts everything, and an even harder time figuring out what path to > stick to PHP ... > > Some detective work gave me these paths: > > MySQL (bins): > /usr/bin > /usr/share/mysql > MySQL daemon (mysqld): > /usr/libexec > /usr/sbin > MySQL headers (.h): > /usr/include/mysql > > I've tried them all, but they all result in the above error. Anyone care to > guess which path I should give to the configure? > > Or is it something else that causes this? > I haven't ever used MySQL before, or any other SQL for that matter, so got > 0 experience in getting the system up and running with it... > > TIA > > Rene > -- > Rene Brehmer > aka Metalbunny > > http://metalbunny.net/ > References, tools, and other useful stuff... > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] mySQL vs pgSQL | php vs others
Dear all; I have been using Mysql for a long time, but I have a benchmark Q. Is pgsql , better ? faster ? more reliable than mysql ? any comment ? Some people say that php is not for a very big enterprise, banking , application !! they said that java or even .NET is better ... I m against that but what do you all think ? nabil -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] MSSQL Procedures
Jeson Hi , this is Nabil from PHP list, i wonder if u could help with the following: I have a stored procedure on a remote Microsoft (stupid) SQL server.. and I have to connect to it remotely and I have only permission to execute those specific procedure , and I only got the returned value... My server that I will connect from is Linux, apache with MySQL database, and my code ofcourse PHP How can i connect to microsoft SQL server from my php linux server..??? i think ODBC is not excisted in Linux... ( I reserve to myself to be wrong)... Please help me if I can , how can I connect to that server , and execute them, and get the return values... One of the stored procedures that i got a copy from the remote administrator is : Waiting for any comment / --== === CREATE PROCEDURE ChangePasswd @login varchar(32) , @oldpass varchar(16), @newpass varchar(16) AS declare @chkpass int set @chkpass = (select count(*) from subaccounts where [EMAIL PROTECTED] and [EMAIL PROTECTED]) if @chkpass<>0 begin update subaccounts set [EMAIL PROTECTED] where [EMAIL PROTECTED] and [EMAIL PROTECTED] select '0' as err end else begin select '1' as err end Go --== === -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php