RE: [PHP-DB] Access counter
Another idea of mine: You could start sessions and register a variable... and everytime a new user wants to request a page you can find out whether its a new user or not if you check the variable ... If it is new, then do the stuff below ... elso donĀ“t ... Cheers, Marcel -Original Message- From: leo g. divinagracia iii [SMTP:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 06:25 Cc: PHP-DB Subject: Re: [PHP-DB] Access counter in a simple way, yes. if you really want unique users, you can setup a table and insert the IP addresses in their and query it everytime. the PHP variable that keeps track of the user'a IP address can also be checked by storing it in a variable and re-checked each time the page is loaded. Shahmat Dahlan wrote: If I do the below, like you stated, that means the counter will update everytime a visitor refreshes the content. Would it be possible for the counter script not to increase the value by 1 when a visitor merely refreshes. Is it possible to let the script increase the value by only by one, only if the the visitor for a new content (by clearing the cache, e.g.). Thanks you replying.. leo g. divinagracia iii wrote: in pseudo-code: make a text file - associate it a URL when a user comes along, have a PHP script on top of the web page to 1. open the text file 2. counter = counter +1 3. write update 3.5 print number of hits somewhere on webpage 4. close file... Shahmat Dahlan wrote: I'd like to do a counter with PHP, how do you do this? I thought maybe I could either use cookie or session or session? Which should I use ? -- Leo G. Divinagracia III [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] If you have received this e-mail in error or wish to read our e-mail disclaimer statement and monitoring policy, please refer to http://www.drkw.com/disc/email/ or contact the sender. -- 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] search form
hello everyone, i have a search form and i want it to search the entire site. what will i do if not all the information in my site came from the database ... thanks
Re: [PHP-DB] line breaks in mySQL text fields
Hi, You could put \n where you want the new line. Than if you want to output the text field in HTML you could use nl2br() to replace the new line characters with br For example take a look at this INSERT query: $sql= INSERT INTO table_name (text_field,...other_fields) VALUES ('first row\nsecond row',...other_values); Hope this helps Dobromir Velev -Original Message- From: kmurrah [EMAIL PROTECTED] To: [EMAIL PROTECTED] [EMAIL PROTECTED] Date: Monday, July 23, 2001 9:15 PM Subject: [PHP-DB] line breaks in mySQL text fields How do I add new line characters to a text field in mySQL ? i.e. i need to manually insert returns into my text ... thanks in advance, KennM -- 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] phpmyadmin troubles - creating tables
you need INT(16) or something, as in in phpmyadmin, enter an integer for the size of the field as well when defining it :) // -Original Message- // From: olinux [mailto:[EMAIL PROTECTED]] // Sent: Tuesday, 24 July 2001 2:08 PM // To: php-db // Subject: [PHP-DB] phpmyadmin troubles - creating tables // // // OK, I have no idea why but i have spent the past hour trying // to create this // stupid table. I am using the latest version of phpmyadmin. I // created the // query several times thru the interface and then played with // the query in the // textbox. I need help badly. // // CREATE TABLE users (id INT (9) not null , user VARCHAR (12) // not null , // pass VARCHAR (45) not null , permission ENUM , package INT // not null , // apartment VARCHAR (75) not null , apt_address VARCHAR (120) // not null , // apt_city VARCHAR (45) not null , apt_state CHAR (2) not // null , apt_zip // CHAR (5) not null , con_first VARCHAR (25) not null , // con_last VARCHAR // (30) not null , con_phone VARCHAR (15) not null , // con_phone_2 VARCHAR (15) // not null , con_fax VARCHAR (15) not null , con_email // VARCHAR (70) not null // , bill_first VARCHAR (25) not null , bill_last VARCHAR (30) // not null , // bill_address VARCHAR (120) not null , bill_city VARCHAR // (45) not null , // bill_state CHAR (2) not null , bill_zip CHAR (5) not null ) // // I would like my table to look like this. I have tried // removing the INT // limit. I have no idea why this is not working. // // the error that returns says: // MySQL said: You have an error in your SQL syntax near ' // package INT not null // , apartment VARCHAR (75) not null , apt_address VARCHAR (' at line 1 // // I have tried creating the table as type myisam and still no luck. // // Thank you, // olinux // // // _ // Do You Yahoo!? // Get your free @yahoo.com address at http://mail.yahoo.com // // // -- // 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] HELP!! - Search
Whats wrong with this?? Its not working... Search.php ?php include(search_bool.inc); ? ?php $connection = mysql_connect($host,$dbusername,$dbpassword) or die (Cannot connect to server.); $db = mysql_select_db($dbname, $connection) or die (Could not select database.); $sqlstring = SELECT * FROM $searchsection WHERE .makeboolean(keyword,$search); $result = mysql_query($sqlstring, $connection) or die (Could not execute query.); if (!$result) { echo pCould not get record.; } if(mysql_num_rows($result)) { $uid = 1; while($row = mysql_fetch_row($result)) { print(font face=\Verdana\ size=\1\ba href=\#\ onclick=\window.open('./view_ep.php3?news_id=$row[0]','','width=490,height=280');\$row[1]/a/bbrbr$row[2]/font/smallp); $uid++; } } ? Search Boolean file I was told to use ## I don't even get these instructions!! *lol* ## usage: makeboolean(fieldname,$searchstring) ## ie: $sqlstring = SELECT * FROM table WHERE .makeboolean(field,$search); class Query { var $m_words; var $m_logic; function Query($logic, $words) { $logic = .$logic. ; $this-m_words = $words; $this-m_logic = $logic; } }; class phpSQLbool { var $m_Querys; var $m_start; var $m_offset; var $m_wordmatch; var $m_casematch; function QueryGenerator($Querys, $wordmatch=false, $casematch=false) { $this-m_Querys = $Querys; $this-m_wordmatch = $wordmatch; $this-m_casematch = $casematch; $this-Restrict(0,0); } function Restrict($start, $offset) { $this-m_start = $start; $this-m_offset = $offset; } function GetRestrict($start, $offset) { $start = $this-m_start; $offset = $this-m_offset; } function GetQueryString($searchfield) { // $query_string = SELECT $resultfield FROM $table WHERE ; $query_string .= $this-BuildQueryString($table, $searchfield); if ($this-m_start || $this-m_offset) { $query_string .= LIMIT $this-m_start; if($this-m_offset) $query_string .= ,$this-m_offset; } return $query_string; } function GetCountQueryString($table, $searchfield) { $query_string = SELECT count(*) FROM $table WHERE ; $query_string .= $this-BuildQueryString($table, $searchfield); return $query_string; } function BuildQueryString($table, $searchfield) { $searchfields = explode(,, $searchfield); if(!is_array($searchfields)) $searchfields=array($searchfield); while ($searchfield = current($searchfields)) { if (!$this-m_casematch) $searchfield = $searchfield; $firstquery = true; reset($this-m_Querys); while($query = current($this-m_Querys)) { if ($firstquery) $firstquery=false; else if ($query-m_logic == NOT) $query_string .=AND ; else $query_string .=$query-m_logic; $query_string .= $this-BuildWhereClause($searchfield, $query); next($this-m_Querys); } if (next($searchfields)) $query_string .= OR; } return $query_string; } function BuildWhereClause($searchfield, $query) { while($word = current($query-m_words)) { if (!$this-m_casematch) $word = sql_regcase($word); if ($this-m_wordmatch) $search_type = REGEXP '[[::]].$word.[[::]]'; else $search_type = REGEXP '$word'; if ($query-m_logic == NOT) $query_string.=$searchfield NOT ; else $query_string.=$searchfield ; $query_string.= $search_type; if (next($query-m_words)) $query_string.= OR ; } return $query_string; } }; function makeboolean($field, $keywords) { $words = explode( , $keywords); for ($i=0; $i count($words); $i++) { $query[] = new Query(AND, array(trim($words[$i]))); } $querygen = new phpSQLbool($query); $query = $querygen-GetQueryString($field); return $query; } ? _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- 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] 'htaccess method : how to modify passwords from PHP scripts ?
Hi all, I use a Linux platform, Apache, and PHP4. I use htaccess method in order to have restricted accesses, and I handle my users via a PHP interface. - when I want to create a new user, I generate a string such as username:cryptedpassword, and I insert it at the end of my .htpasswd file. - when I want to modify the password of an existing user, how to do that ? -- 1/ delete the line corresponding to this user, and then insert the new username:cryptedpassword line ? in this case, can you tell me which funtions to use (find a line in an ascii file, delete it, and insert the new one) ? -- 2/ run a command line such as htpasswd ... (without -c argument) ? in this case, can you tell me how to run a unix command line from a PHP script ? Thanks a lot in advance. Regards, -- Samuel Torton NCSLab.com -- 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] Question regarding php and mysql with binary data...
Hello Again everyone... My question is simple... I have images submited IN my mysql Database. What i want is when i display them and i right click on them and choose save picture as i can get the name of the picture from the DB and not have to insert it my self. Does anyone now how can i do that with a file that comes from a db??? thanks ___ PGP KEY ID: 0xA86600E9 ___
RE: [PHP-DB] Counting Number of Instances in a One2Many Relationships
On Monday, July 23, 2001 at 9:54 PM (ahem, set your clock!), Mike Gifford said: I'd like a simple query to determine how MANY books in a database are released by A publisher. [...] The relevant table's here: CREATE TABLE WLPbib ( bibID mediumint(9) NOT NULL, languageID varchar(5), publisherID mediumint(9), categoryID smallint(6), type varchar(55), title varchar(255), pageNumber varchar(55), source_bibID varchar(55), publicationDate varchar(5), dateAdded date, publishedLanguage varchar(5), URL varchar(100), status varchar(5), PRIMARY KEY (bibID) ); Suggestions are appreciated! SELECT publisherID,count(*) FROM WLPbib GROUP BY publisherID; - Brian --- Brian S. Dunworth Sr. Software Development Engineer Oracle Database Administrator The Printing House, Ltd. (850) 875-1500 x225 --- -- 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] MS SQL datetime format problem
Hi, I am having trouble setting a datetime in a ms sql database. I can put in a date, but when I add the time i always get an error. this is likely something simple, any thoughts? thanks --Brian -- 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] search form
You'll need to write two search engines - one for the db, one for the static pages. Then combine the results on your results page. I'm looking at having to do the same thing, and can't think of a different way of doing it offhand. J- E- N wrote: i have a search form and i want it to search the entire site. what will i do if not all the information in my site came from the database ... -- Chris Hobbs Silver Valley Unified School District Head geek: Technology Services Coordinator webmaster: http://www.silvervalley.k12.ca.us/~chobbs/ postmaster: [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] Dynamic Links
I think this topic was discussed before. But I couldn't find it in the archive. I have this table mysql desc inv_table; +--+--+--+-+-+---+ | Field| Type | Null | Key | Default | Extra | +--+--+--+-+-+---+ | machine_name | char(64) | | | | | | group_name | char(25) | | | | | | OS | char(30) | | | | | | IP | int(15) | | | 0 | | | services | char(35) | | | | | | contact | char(45) | | | | | | suppport | char(45) | | | | | | location | char(30) | | | | | | campus | char(20) | | | | | +--+--+--+-+-+---+ 9 rows in set (0.00 sec) I want to do a browse on the machine name. Then I want to click on that particuluar machine and get rest of the info about that. So I am doing something like this: ? - -- WHILE ( $a_row = mysql_fetch_object($result)) { print a href=\view.php?machine_name=$a_row-machine_name\$a_row-machine_name/a br\n; } ? Is this ok? But what should my view.php will be in this case. How Do I pass the parameter? Any hint? -- 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] log out
Well, i'm having some trouble in here and i hope someone can help me... I'm using sessions to keep track of users on my website... Using this, i'm able to display the name of the users that are currently online... Here's the thing... When users get on the site a new session is opened and they get on the online list... For the logging out, i have a log out button that to the moment very few people have used... I've been looking for some kind of event that may be triggered when a session expires, so that i could change it and do what i need when a user logs out. Unfortunately i have not found anything like this. The way i found to do this was to have people visiting the site doing this job for me. Every time a page is requested it checks the time of the last page hit from every online user and if the difference to the current time is more than some default i specify, it puts it as offline. Another way was to have cron do this for me... But i still wonder if it's possible to have php sessions do this for me, as some kind of mechanism must exists for the session expires... -- 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] Oracle 9i Support
Hello, I am trying to use php 4.0.6 with an Oracle 9i database. Using the --with-oci8 compile option does not seem to work as it gives me the following message: checking Oracle version... configure: error: Oracle-OCI8 needed libraries not found Is there any way I can trick php (or oracle) into thinking that the 9i libraries are 8i libraries (symklinks perhaps) or is 9i so different from 8i that I am going to just have to wait for it to be supported? If so does anyone have any idea when 9i will be supported? Thanks, -Lee -- 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] Quick mysqld question...
I recently installed PHP4, Apache, and MySQL on my computer for various reasons. Everything was working smoothly for a while, but today when I tried to start mysqld I got this error message: Can't initialize InnoDB as innodb_data_file_path is not set. Any idea what this means, and how I can fix it? Thanks! -- -Ryan :: ICQ - 595003 :: GigaBoard - http://www.gigaboard.net/ -- 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 and oracle outer join syntax
In Oracle, the syntax for a theta-style join (the one you're describing) is: SELECT ... FROM ... WHERE item1 (+) = item2 However, MySQL doesn't support this syntax. The only way to do left (outer) joins in mysql is the way you described: SELECT ... FROM ... LEFT JOIN ... ON ... = ... -Original Message- From: alvin townsend [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 2:02 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] mysql and oracle outer join syntax hello all. i have a question - but first some background... the standard LEFT JOIN syntax is something like this: SELECT t1.a, t1.b, t1.c, t2.d, t2.e FROM table1 t1 LEFT JOIN table2 t2 ON t1.x = t2.x WHERE t1.a = 'some condition or another'; i much prefer to do LEFT JOINs like this however: SELECT t1.a, t1.b, t1.c, t2.d, t2.e FROM table1 t1, table2 t2 WHERE t1.x = t2.x AND t1.a = 'some condition or another'; however, now i've got to convert this to an OUTER JOIN. i know that with oracle, you can add a plus somewhere like this (although i'm unclear what the precise syntax is): SELECT t1.a, t1.b, t1.c, t2.d, t2.e FROM table1 t1, table2 t2 WHERE t1.x = t2.x+ [note the plus here] AND t1.a = 'some condition or another'; and now the question does anyone know if there's a way with mysql to use the oracle-esqe + to do an OUTER JOIN so i don't have to go back and rewrite all of my sql statements? thanks a lot! alvin -- 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] php script showing up on web page!!!!
Here is the link to the problem page, http://www.youngsmall.com/cgi-local/shop.pl/page=index222.htm This PHP script shows up below buy now button. Can anybody tell me what I am doing wrong? This is script that I am using on each buy buttons, ?php $link = mysql_connect(x,xx,xx) or die (Could not connect); if (! @mysql_select_db(x) ) { echo( PUnable to locate the inventory . database at this time./P ); exit();} $itemx = 6505; $sql = SELECT quantity FROM inventory WHERE item = '$itemx'; $result = mysql_query($sql,$link); $row = mysql_fetch_array($result); // you have to fetch the result into an array to access the info in the db $num = $row[quantity]; // NOW we can compare $num ;) if ($num 1) { echo bfont color=\#FF\Out of Stock/font/b; } else { echo bfont color=\#FF\In Stock/font/b; } mysql_close($link); ? Thanks for your time. Tony -- 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] Re: php script showing up on web page!!!!
Well unless you set up your webserver to parse .htm pages then your code will not be parsed and is displayed as plain text. -- phill Tony [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Here is the link to the problem page, http://www.youngsmall.com/cgi-local/shop.pl/page=index222.htm This PHP script shows up below buy now button. Can anybody tell me what I am doing wrong? This is script that I am using on each buy buttons, ?php $link = mysql_connect(x,xx,xx) or die (Could not connect); if (! @mysql_select_db(x) ) { echo( PUnable to locate the inventory . database at this time./P ); exit();} $itemx = 6505; $sql = SELECT quantity FROM inventory WHERE item = '$itemx'; $result = mysql_query($sql,$link); $row = mysql_fetch_array($result); // you have to fetch the result into an array to access the info in the db $num = $row[quantity]; // NOW we can compare $num ;) if ($num 1) { echo bfont color=\#FF\Out of Stock/font/b; } else { echo bfont color=\#FF\In Stock/font/b; } mysql_close($link); ? Thanks for your time. Tony -- 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] Problem with my first script
I'm trying to retrieve data from a MySql Database I have the following php script: ? echo Resultados de tabla Empresas; echobr; $link = mysql_connect (localhost:3306, root, ) or die (Could not connect); print (Connected successfully); mysql_select_db (seguros); $sql=select * from mae_companias; $result=mysql_query($sql,$link); echo table align='center'trtd/tdNombretdDireccion/tdtdTelefono/tdtdFax /td; $num=mysql_num_rows($result); $cur=1; while($num=$cur){ $myrow=mysql_fetch_array ($result); $nombre=$myrow(nombre); $direccion=$myrow(direccion); $telefono=$myrow(telefono); $fax=$myrow(fax); echo trtd$nombre/tdtd$direccion/tdtd$telefono/tdtd$fax/td; $cur++; } echo /table; ? When I call this page I get the following error: Fatal error: Call to undefined function: array() in /home/fergonza/mod_php4/index.php on line 18 Line 18 is refwrring to the line where I have $myrow=mysql_fetch_array ($result); Anyone can help?? -- 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] Problem with my first script
i havent tested it yet... but... Fernando Gonzalez wrote: $num=mysql_num_rows($result); $cur=1; while($num=$cur){ $myrow=mysql_fetch_array ($result); ^^ you got a space after the function and the open paren. NO SPACES (as i found before that took about 10 minutes of debugging on a similar debugging session...) ;-))) -- Leo G. Divinagracia III [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] Question regarding php and mysql with binary data...
the web page that is generated, does the HREF tag supply a name? and at least for my netscrape 4.7x, whenever i right click on an image, it uses that name on the dialog box that pops up, prompting me where and how to save it as... btw, why save images on a table? wouldnt saving the URL better? the pixs themselves would sit on separate folder or something... Koutsogiannopoulos Karolos wrote: Hello Again everyone... My question is simple... I have images submited IN my mysql Database. What i want is when i display them and i right click on them and choose save picture as i can get the name of the picture from the DB and not have to insert it my self. Does anyone now how can i do that with a file that comes from a db??? thanks ___ PGP KEY ID: 0xA86600E9 ___ -- Leo G. Divinagracia III [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] search form
Build the keywords for the static pages into the existing db table. a lot of work so you will have to remember to delete changed/delete url's olinux -Original Message- From: J- E- N [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 2:48 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] search form hello everyone, i have a search form and i want it to search the entire site. what will i do if not all the information in my site came from the database ... thanks _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- 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] Problem with my first script
snip $myrow=mysql_fetch_array ($result); /snip Remove the space in the function call and it should work fine for you ie. $myrow=mysql_fetch_array($result); Sincerely, Craig Vincent -- 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] search form
ot reply: use a text-indexing database, pass it a stored procedure against the index. not php, but it'll work. also, xml compliant pages will allow you to search them via xpath. cheers, jaxon On Tuesday, July 24, 2001, at 07:43 PM, olinux wrote: Build the keywords for the static pages into the existing db table. a lot of work so you will have to remember to delete changed/delete url's olinux -Original Message- From: J- E- N [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 2:48 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] search form hello everyone, i have a search form and i want it to search the entire site. what will i do if not all the information in my site came from the database ... thanks _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- 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] Problem with my first script
Thanks, but it wont work. I have eliminate the space but still the same message. I have realized that the problem is below that line: the problem is pointing to the line where i fetch the first variable: $nombre=$myrow(nombre); Any other Ideas thanks ? echo Resultados de tabla Empresas; echobr; $link = mysql_connect (localhost:3306, root, ) or die (Could not connect); print (Connected successfully); mysql_select_db (seguros); $sql=select * from mae_companias; $result=mysql_query($sql,$link); echo table align='center'trtd/tdNombretdDireccion/tdtdTelefono/tdtdFax /td; $num=mysql_num_rows($result); $cur=1; while($num=$cur){ $myrow=mysql_fetch_array ($result); $nombre=$myrow(nombre); $direccion=$myrow(direccion); $telefono=$myrow(telefono); $fax=$myrow(fax); echo trtd$nombre/tdtd$direccion/tdtd$telefono/tdtd$fax/td; $cur++; } echo /table; ? - Original Message - From: leo g. divinagracia iii [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, July 24, 2001 7:52 PM Subject: Re: [PHP-DB] Problem with my first script i havent tested it yet... but... Fernando Gonzalez wrote: $num=mysql_num_rows($result); $cur=1; while($num=$cur){ $myrow=mysql_fetch_array ($result); ^^ you got a space after the function and the open paren. NO SPACES (as i found before that took about 10 minutes of debugging on a similar debugging session...) ;-))) -- Leo G. Divinagracia III [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]
Re: [PHP-DB] Problem with my first script
1. safe to assume that there is a column named nombre? 2. try using index numbers instead, i.e;, instead of $myrow(nombre), try $myrow(1)... Fernando Gonzalez wrote: Thanks, but it wont work. I have eliminate the space but still the same message. I have realized that the problem is below that line: the problem is pointing to the line where i fetch the first variable: $nombre=$myrow(nombre); -- Leo G. Divinagracia III [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] Problem with my first script
on 6/24/01 7:23 PM, Fernando Gonzalez at [EMAIL PROTECTED] wrote: I have eliminate the space but still the same message. $myrow=mysql_fetch_array ($result); Fatal error: Call to undefined function: array() in /home/fergonza/mod_php4/index.php on line 18 I wonder if somehow you have an invisible control character between the mysql_fetch_ and the array part. Try deleting the line and retyping: $myrow = mysql_fetch_array($result); Hope that helps. Sincerely, Paul Burney ++ Paul Burney Webmaster Open Source Developer UCLA - GSEIS - ETU (310) 825-8365 [EMAIL PROTECTED] http://www.gseis.ucla.edu/ ++ -- 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]