Re: [PHP-DB] Help needed - SELECT query optimization

2008-10-26 Thread Chris



It should be a rapidshare links database (which updates with a PHP crawler I
wroted last Saturday).
I would like to change the snippet to title and add another column for the
snippet,
My main queries are INSERT's - a big insert (usually 10-100 links per
insert) in each hour.
My crawler is checking if the link it is about to add is already in the
database with a select query like this:
SELECT `id` FROM `tbl_name` WHERE `unique` = '%_UNIQUE_VARIABLE_%'


create index unique_idx on tbl_name(unique);

mysql might work better with this index:

create index unique_idx on tbl_name(unique, id);

because in some cases it doesn't have to go back to the data file to get 
the actual data, it can just read everything from the index.



I'm definiatly not an database scheme expert, I'm looking to optimaize the
table for fast select queries (to check if file is already exists)
And for fast filename-based search (select * from `tbl_name` where
`filename` like '%_WHATEVER_%')


like queries are harder to optimize.

If you put a wildcard at the front:

like '%...%';

the db can't use an index to find it, because you're saying the text can 
be anywhere and for that type of search you're best off setting up 
fulltext (http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html).


If you don't put a % at the front:

like '...%';

the db use an index to find it (up until the wildcard)..

create index filename_idx on tbl_name(filename);


To understand indexing, check out my article:

http://www.designmagick.com/article/16/PostgreSQL/How-to-index-a-database

(Yes it's on a postgres site but the ideas/understanding work for all 
db's - and the commands should even work for mysql).


--
Postgresql  php tutorials
http://www.designmagick.com/


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Help Needed!!

2006-11-08 Thread John Meyer
Forgive me for saying this, but you should be posting this to the Oracle
mailing list, not here.

David Skyers wrote:
 Hello,

 I have an input field that inserts data into an oracle table. The users
 of the system will be composing the data that goes into this input field
 in Microsoft Word. 

 They will also be using Microsoft Word formatting features.

 1. Is it possible for my input box to retain the formatting and if so
 how?
 2. Can the Oracle database store this type of formatting?
 3. Can the data and formatting then be extracted in XML

 Thanks,

 David


 
 David Skyers
 Support Analyst
 Management Systems, EISD, UCL
 Extension: 41849
 Tel: 020 7679 1849
 Email: [EMAIL PROTECTED]
  

   

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] Help Needed!!

2006-11-08 Thread Bastien Koert
1. yes, user a rich text editor plugin in you web page 
(http://www.kevinroth.com/rte/ is one such beast)


2. sure, in a text / blob field

3. yes, but likely you'll need to do it as CDATA

hth

Bastien





From: David Skyers [EMAIL PROTECTED]
To: php-db@lists.php.net
Subject: [PHP-DB] Help Needed!!
Date: Wed, 8 Nov 2006 11:59:28 -

Hello,

I have an input field that inserts data into an oracle table. The users
of the system will be composing the data that goes into this input field
in Microsoft Word.

They will also be using Microsoft Word formatting features.

1. Is it possible for my input box to retain the formatting and if so
how?
2. Can the Oracle database store this type of formatting?
3. Can the data and formatting then be extracted in XML

Thanks,

David



David Skyers
Support Analyst
Management Systems, EISD, UCL
Extension: 41849
Tel: 020 7679 1849
Email: [EMAIL PROTECTED]


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



_
Say hello to the next generation of Search. Live Search – try it now. 
http://www.live.com/?mkt=en-ca


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] Help needed creating a social network

2006-03-07 Thread Daevid Vincent
Thanks for the reply. However, that only gives me a single degree. 

I'm looking for the way to traverse a 'tree' to see who is in your extended
networks, so I can do things like:

You are 4 degrees away from Sam:

You know bob who knows john who knows carrol who knows Sam. 

Sam - carrol - john - bob - you

Etc.


 -Original Message-
 From: Micah Stevens [mailto:[EMAIL PROTECTED] 
 Sent: Monday, March 06, 2006 10:28 PM
 To: php-db@lists.php.net
 Subject: Re: [PHP-DB] Help needed creating a social network
 
 
 CREATE TABLE `users` (userID int(11) not null auto_increment, primary 
 key(userID), name tinytext not null, email tinytext not null);
 
 CREATE TABLE `links` (userID int(11), key (userID), friendID int(11), 
 key(friendID));
 
 ?php
 $friends = mysql_query(select users.name, users.userID from 
 users left join 
 links on links.friendID = users.userID where links.userID = 
 {$_GET['userID']});
 
 echo h1You have friends!!/h1;
 while ($f = mysql_fetch_assoc($friends)) {
 echo a 
 href='socialnetwork.php?userID={$f['userID']}'{$f['name']}/a
 br\n;
 }
 
 publish();
 profit($greatly);
 do (!$use) {
   coldfusion('Cause it sucks');
 }
 ?
 
 (har har) 
 
 
 
 
 
 
 
 On Monday 06 March 2006 9:47 pm, Daevid Vincent wrote:
  Anyone have some pointers at a HowTo on creating a social network?
 
  Basically I need to show people in your immediate network, 
 and also friends
  of your friends, etc... Like the whole 'six degrees of 
 separation' thing.
  Ala: myspace, friendster, etc. ad nauseum.
 
  I prefer mySQL and PHP, but I could port from most any 
 code. I guess I'm
  mostly interested in the theory of this an how do I set up 
 the tables
  properly and what is the magic incantation (JOIN) to get 
 this chain of
  people.
 
 -- 
 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] Help needed creating a social network

2006-03-07 Thread Miles Thompson


My first thought was recursion - repeat the call for each element of the 
result set, numbering each so you can find each level, until nothing is 
returned. That would probably work, but oh, what a mess.


That triggered something  ... off to consult Joe Celko's SQL for Smarties. 
He has a whole chapter on Trees, and guess what: they're not easily done in 
relational databases. To try and condense it here would be, shall we say, 
impractical.


Check with a library, or try googling for trees -- hey, look what turned up:
http://www.dbmsmag.com/9603d06.html
by JC himself.

Have fun - Miles Thompson

At 03:19 PM 3/7/2006, Daevid Vincent wrote:


Thanks for the reply. However, that only gives me a single degree.

I'm looking for the way to traverse a 'tree' to see who is in your extended
networks, so I can do things like:

You are 4 degrees away from Sam:

You know bob who knows john who knows carrol who knows Sam.

Sam - carrol - john - bob - you

Etc.


 -Original Message-
 From: Micah Stevens [mailto:[EMAIL PROTECTED]
 Sent: Monday, March 06, 2006 10:28 PM
 To: php-db@lists.php.net
 Subject: Re: [PHP-DB] Help needed creating a social network


 CREATE TABLE `users` (userID int(11) not null auto_increment, primary
 key(userID), name tinytext not null, email tinytext not null);

 CREATE TABLE `links` (userID int(11), key (userID), friendID int(11),
 key(friendID));

 ?php
 $friends = mysql_query(select users.name, users.userID from
 users left join
 links on links.friendID = users.userID where links.userID =
 {$_GET['userID']});

 echo h1You have friends!!/h1;
 while ($f = mysql_fetch_assoc($friends)) {
 echo a
 href='socialnetwork.php?userID={$f['userID']}'{$f['name']}/a
 br\n;
 }

 publish();
 profit($greatly);
 do (!$use) {
   coldfusion('Cause it sucks');
 }
 ?

 (har har)







 On Monday 06 March 2006 9:47 pm, Daevid Vincent wrote:
  Anyone have some pointers at a HowTo on creating a social network?
 
  Basically I need to show people in your immediate network,
 and also friends
  of your friends, etc... Like the whole 'six degrees of
 separation' thing.
  Ala: myspace, friendster, etc. ad nauseum.
 
  I prefer mySQL and PHP, but I could port from most any
 code. I guess I'm
  mostly interested in the theory of this an how do I set up
 the tables
  properly and what is the magic incantation (JOIN) to get
 this chain of
  people.

 --
 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



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.375 / Virus Database: 268.2.0/275 - Release Date: 3/6/2006

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Help needed creating a social network

2006-03-06 Thread Micah Stevens

CREATE TABLE `users` (userID int(11) not null auto_increment, primary 
key(userID), name tinytext not null, email tinytext not null);

CREATE TABLE `links` (userID int(11), key (userID), friendID int(11), 
key(friendID));

?php
$friends = mysql_query(select users.name, users.userID from users left join 
links on links.friendID = users.userID where links.userID = 
{$_GET['userID']});

echo h1You have friends!!/h1;
while ($f = mysql_fetch_assoc($friends)) {
echo a 
href='socialnetwork.php?userID={$f['userID']}'{$f['name']}/abr\n;
}

publish();
profit($greatly);
do (!$use) {
coldfusion('Cause it sucks');
}
?

(har har) 







On Monday 06 March 2006 9:47 pm, Daevid Vincent wrote:
 Anyone have some pointers at a HowTo on creating a social network?

 Basically I need to show people in your immediate network, and also friends
 of your friends, etc... Like the whole 'six degrees of separation' thing.
 Ala: myspace, friendster, etc. ad nauseum.

 I prefer mySQL and PHP, but I could port from most any code. I guess I'm
 mostly interested in the theory of this an how do I set up the tables
 properly and what is the magic incantation (JOIN) to get this chain of
 people.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] Help Needed with malfunctioning query

2006-02-25 Thread Chris Payne
Hi there,

I'm using asd just to test the search, here's the output from the statement
echoed to the screen:

SELECT word,def,photo, if(locate('asd',word),1,2) as meFirst
,MATCH(word,def) AGAINST ('asd' IN BOOLEAN MODE) AS m FROM dictionary WHERE
MATCH(word,def) AGAINST ('asd' IN BOOLEAN MODE) ORDER BY meFirst, word LIMIT
0, 25

Chris

This line of code USED TO WORK but now it gives me a Coudln't Execute 
Query
error:
 
$query2 = SELECT word,def,photo MATCH(word,def) AGAINST 
('$txtsearchword'
IN BOOLEAN MODE) AS m FROM dictionary WHERE MATCH(word,def) AGAINST 
('$txtsearchword' IN BOOLEAN MODE) LIMIT $offset, $item_perpage;

What is the exact error phrase?  Did you echo the $sql statement so you can
see if the variables are correct?


--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 268.1.0/269 - Release Date: 2/24/2006

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Help Needed with malfunctioning query

2006-02-25 Thread Murray @ PlanetThoughtful

On 26/02/2006 3:03 PM, Chris Payne wrote:

Hi there everyone,
 
This line of code USED TO WORK but now it gives me a Coudln't Execute Query

error:
 
$query2 = SELECT word,def,photo MATCH(word,def) AGAINST ('$txtsearchword'

IN BOOLEAN MODE) AS m FROM dictionary WHERE MATCH(word,def) AGAINST
('$txtsearchword' IN BOOLEAN MODE) LIMIT $offset, $item_perpage;

I tried it with a basic $query2 = SELECT * FROM dictionary; to make sure
it wasn't something else that was broke and this is the problem above, it
used to work great and now it's on a live site after working great for 6
months and it suddenly doesn't work and I haven't touched anything !!!  the
server hasn't been updated so it's not that as it also does the same on my
local dev machine here, the only thing that happened was my co-worker did a
global find and replace with dreamweaver but that's all and I can't
personally see anything wrong with the above though I could be looking too
hard.
  


Should there be a comma between 'photo' and 'MATCH(word, def) etc'?

As in:
$query2 = SELECT word,def,photo, MATCH(word,def) AGAINST 
('$txtsearchword' IN BOOLEAN MODE) AS m FROM dictionary WHERE 
MATCH(word,def) AGAINST ('$txtsearchword' IN BOOLEAN MODE) LIMIT 
$offset, $item_perpage;



Much warmth,

planetthoughtful
---
Lost in thought
http://www.planetthoughtful.org

Urban legends, superstitions, ghost
stories and folklore
http://www.ulblog.org

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] Help Needed

2005-07-29 Thread ReClMaples
Sorry, the data under 'Looking something like this' should be in a table
format with 3 columns and 4 rows.

-Original Message-
From: ReClMaples [mailto:[EMAIL PROTECTED]
Sent: Friday, July 29, 2005 8:46 PM
To: PHP
Subject: [PHP-DB] Help Needed

All,

 I know this is the wrong distro to be sending this request for help to
but I don't know which one to send this to.  If you could either point me in
the direction that I should go or help me, I would greatly appreciate it.

Here is my issue.

I have a set of date that I want returned in 3 columns and an unspecified
number of rows (dependent on the number of records returned).  I cannot for
the life of me figure out how to do this.

Looking something like this

1st record
2Nd record
3trd record
4th record
5th record
6th record
7th record
8th record
9th record
And so on
And so fourth
...



Can any one help me out with this, or point me to the distro that can help
me?

Thanks
-Rich

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Help Needed

2005-07-29 Thread Alain Rivest

ReClMaples a écrit :


Sorry, the data under 'Looking something like this' should be in a table
format with 3 columns and 4 rows.

-Original Message-
From: ReClMaples [mailto:[EMAIL PROTECTED]
Sent: Friday, July 29, 2005 8:46 PM
To: PHP
Subject: [PHP-DB] Help Needed

All,

I know this is the wrong distro to be sending this request for help to
but I don't know which one to send this to.  If you could either point me in
the direction that I should go or help me, I would greatly appreciate it.

Here is my issue.

I have a set of date that I want returned in 3 columns and an unspecified
number of rows (dependent on the number of records returned).  I cannot for
the life of me figure out how to do this.

 


You can do something like this :

$i = 0 ;
echo tabletr;
while (fetch...)
{
   echo td$your_data/td ;

   // every 3 row
   if ($i % 3 == 0)
  echo /trtr ;

   $i ++ ;
}
echo /tr/table ;

I know it's not perfect, I'll let you rewrite it more elegantly...


--

Alain -- http://www.vivahate.org

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] Help Needed

2005-07-29 Thread ReClMaples
You ROCK!!!  Thanks so much, this worked perfectly!!!

Thanks
-Rich

-Original Message-
From: Alain Rivest [mailto:[EMAIL PROTECTED]
Sent: Friday, July 29, 2005 10:10 PM
To: php-db@lists.php.net
Subject: Re: [PHP-DB] Help Needed

ReClMaples a écrit :

Sorry, the data under 'Looking something like this' should be in a table
format with 3 columns and 4 rows.

-Original Message-
From: ReClMaples [mailto:[EMAIL PROTECTED]
Sent: Friday, July 29, 2005 8:46 PM
To: PHP
Subject: [PHP-DB] Help Needed

All,

 I know this is the wrong distro to be sending this request for help to
but I don't know which one to send this to.  If you could either point me
in
the direction that I should go or help me, I would greatly appreciate it.

Here is my issue.

I have a set of date that I want returned in 3 columns and an unspecified
number of rows (dependent on the number of records returned).  I cannot for
the life of me figure out how to do this.



You can do something like this :

$i = 0 ;
echo tabletr;
while (fetch...)
{
echo td$your_data/td ;

// every 3 row
if ($i % 3 == 0)
   echo /trtr ;

$i ++ ;
}
echo /tr/table ;

I know it's not perfect, I'll let you rewrite it more elegantly...


--

Alain -- http://www.vivahate.org

--
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] Help needed

2004-10-04 Thread Gary Every
Check to see if your register_globals is set to off in php.ini. If so
(likely, since it defaults to that value) you'll need to access your
POST and GET variables like this:
GET vars:
$var = $_GET['var'];

POST vars:
$var = $_POST['var'];



Gary Every
Sr. UNIX Administrator
Ingram Entertainment Inc.
2 Ingram Blvd, La Vergne, TN 37089
Pay It Forward!


-Original Message-
From: Manoj Japher [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 04, 2004 9:29 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Help needed


hi,
 I am new to PHP and I am not sure if this is the right forum.

 I am trying to run PHP thro webmin using CGI scripts. PHP runs fine
except that when I am trying to read variables coming thro' a form after
hitting the submit button, I get NULL values.

 I can read and write to the database without any trouble. The problem
is reading the form values.

Any help would be greatly appreciated.

Many Thanks,

Manoj


Life,it is not a problem to be solved, but 
a process to be managed.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] Help needed with variable scoping? or mysql problem

2003-08-23 Thread Mike Klein
Oh yeah that's the ticket!

I'd forgotten that I'd removed the mysql_select_db statement when doing
some earlier 'cleanup'. It just so happens that a few of the mysql metadata
calls (like listing fields/etc.) were inadvertently setting the db...but
only for a brief period of time...wierd.

As I mentioned, I just started using php yesterday, so I'm still learning
some tips/tricks.

But...to php's credit, I gotten a fairly functional rdbms
explorer/browser/editor going in under a day. I had initially planned on
'hardcoding' some rdbms master/detail forms, but after doing just one of
them, and seeing the plethora of mysql calls available, I decided to
genericize the code, and now it's a general explorer/etc. for all of my
databases. Seems pretty speedy too.

Now I just need to add result set 'scrolling'. Returning 2000 records is not
nice...


thanks buddy...



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 14, 2003 8:10 AM
To: Mike Klein
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Help needed with variable scoping? or mysql
problem



best way to tell is to place .'or die(mysql_error())' after any call to
mysql_query() to see what mysql is complaining about.  personally I
sometimes declare the query first so i can echo that as well after the
msyql_error() function, so i can see the query that has just been
excecuted.  helpful with dynamic queries.

$qry = SELECT * FROM $tableName where $fieldName='$fieldValue';
$result = mysql_query($qry, $conn) or die(mysql_error() . $qry);

hth
jeff



  Mike Klein
  [EMAIL PROTECTED]To:
[EMAIL PROTECTED]
  rg  cc:
   Subject:  [PHP-DB] Help
needed with variable scoping? or mysql problem
  08/14/2003 08:58
  AM






I've been using JSP for some time now, and thought I'd write a couple of
rdbms explorers (flat tables, simple master/detail paradigm) using other
technologies, like PHP, Cocoon, etc. Well...it's been fun. I have more
working than not. But now I am hung up. I am getting wierd results in a php
script when I simply change the order of some mysql calls.

I'm using php-4.3.2, rh9, and mysql 3.23.

My error is the following (the first line above the Warning below is a dump
of parameters to the showMaster function which is what's bombing):

conn=Resource id #3 databaseName=info tableName=movies fieldName=title
fieldValue=36th Chamber
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result
resource in /foo/bar/mywebsite/private/database.php on line 107

Line 107 is the first mysql_num_rows call below.

function showMaster($conn, $databaseName, $tableName, $fieldName,
$fieldValue)
{
echo conn=$conn\n;
echo databaseName=$databaseName\n;
echo tableName=$tableName\n;
echo fieldName=$fieldName\n;
echo fieldValue=$fieldValue\n;

This code fails when placed here==
$result = mysql_query(SELECT * FROM $tableName where
$fieldName='$fieldValue', $conn);
$numRows = mysql_num_rows($result);
if(mysql_num_rows($result) == 1)
{
showDetail($conn, $databaseName, $tableName, $fieldName,
$fieldValue, $result);
exit;
}
echo numRows=$numRows\n;


$fields = mysql_list_fields($databaseName, $tableName, $conn);
$numFields = mysql_num_fields($fields);
echo TABLE border=1 width=100%\n;
echo tr;
for($i = 0; $i  $numFields; $i++)
{
printf(td%s/td, mysql_field_name($fields, $i));
}
echo /tr;

The SAME code succeeds when placed here!==
$result = mysql_query(SELECT * FROM $tableName where
$fieldName='$fieldValue', $conn);
$numRows = mysql_num_rows($result);
if(mysql_num_rows($result) == 1)
{
showDetail($conn, $databaseName, $tableName, $fieldName,
$fieldValue, $result);
exit;
}
echo numRows=$numRows\n;


while($myrow = mysql_fetch_array($result))
...rest of method...
}

Any ideas on why this is? When I move the lines above (from
$result=...to...echo 'numRows') down a few lines to just before the
mysql_fetch_array, then everything works. Whazzup?!?


mike klein



--
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] Help needed with variable scoping? or mysql problem

2003-08-14 Thread jeffrey_n_Dyke

best way to tell is to place .'or die(mysql_error())' after any call to
mysql_query() to see what mysql is complaining about.  personally I
sometimes declare the query first so i can echo that as well after the
msyql_error() function, so i can see the query that has just been
excecuted.  helpful with dynamic queries.

$qry = SELECT * FROM $tableName where $fieldName='$fieldValue';
$result = mysql_query($qry, $conn) or die(mysql_error() . $qry);

hth
jeff


   
 
  Mike Klein 
 
  [EMAIL PROTECTED]To:   [EMAIL PROTECTED]
   
  rg  cc: 
 
   Subject:  [PHP-DB] Help needed with 
variable scoping? or mysql problem   
  08/14/2003 08:58 
 
  AM   
 
   
 
   
 




I've been using JSP for some time now, and thought I'd write a couple of
rdbms explorers (flat tables, simple master/detail paradigm) using other
technologies, like PHP, Cocoon, etc. Well...it's been fun. I have more
working than not. But now I am hung up. I am getting wierd results in a php
script when I simply change the order of some mysql calls.

I'm using php-4.3.2, rh9, and mysql 3.23.

My error is the following (the first line above the Warning below is a dump
of parameters to the showMaster function which is what's bombing):

conn=Resource id #3 databaseName=info tableName=movies fieldName=title
fieldValue=36th Chamber
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result
resource in /foo/bar/mywebsite/private/database.php on line 107

Line 107 is the first mysql_num_rows call below.

function showMaster($conn, $databaseName, $tableName, $fieldName,
$fieldValue)
{
echo conn=$conn\n;
echo databaseName=$databaseName\n;
echo tableName=$tableName\n;
echo fieldName=$fieldName\n;
echo fieldValue=$fieldValue\n;

This code fails when placed here==
$result = mysql_query(SELECT * FROM $tableName where
$fieldName='$fieldValue', $conn);
$numRows = mysql_num_rows($result);
if(mysql_num_rows($result) == 1)
{
showDetail($conn, $databaseName, $tableName, $fieldName,
$fieldValue, $result);
exit;
}
echo numRows=$numRows\n;


$fields = mysql_list_fields($databaseName, $tableName, $conn);
$numFields = mysql_num_fields($fields);
echo TABLE border=1 width=100%\n;
echo tr;
for($i = 0; $i  $numFields; $i++)
{
printf(td%s/td, mysql_field_name($fields, $i));
}
echo /tr;

The SAME code succeeds when placed here!==
$result = mysql_query(SELECT * FROM $tableName where
$fieldName='$fieldValue', $conn);
$numRows = mysql_num_rows($result);
if(mysql_num_rows($result) == 1)
{
showDetail($conn, $databaseName, $tableName, $fieldName,
$fieldValue, $result);
exit;
}
echo numRows=$numRows\n;


while($myrow = mysql_fetch_array($result))
...rest of method...
}

Any ideas on why this is? When I move the lines above (from
$result=...to...echo 'numRows') down a few lines to just before the
mysql_fetch_array, then everything works. Whazzup?!?


mike klein



--
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] Help Needed

2002-12-26 Thread adi setiawan
-- pada 2002-12-26, 14:36:00 [EMAIL PROTECTED] menulis: --

 
Hi. 
I juz installed a RedHat 8.0 on my machine.
But then I have a problem in configuring Apache 2.0.4 to use PHP 4.20..
It's preety weird.. coz there's nothing shown up in the browser when I
run phpinfo(); or even a simple 'helloworld' code.
When I view the source by right-clicking.. it shows the php code.. but
why it didn't show anything in the browser ???
 
I've done all the procedures according to manual. but not working at
all.

check httpd.conf or something similar  make sure correct .php parsing

salam,
adi s. 




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] Help Needed

2002-12-26 Thread dufronte
Everything's perfect.. except my browser keep blank when I run my php
files...


--www.kapsul.org--
  DuFronte

-Original Message-
From: adi setiawan [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, December 26, 2002 5:00 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Help Needed

-- pada 2002-12-26, 14:36:00 [EMAIL PROTECTED] menulis: --

 
Hi. 
I juz installed a RedHat 8.0 on my machine.
But then I have a problem in configuring Apache 2.0.4 to use PHP 4.20..
It's preety weird.. coz there's nothing shown up in the browser when I
run phpinfo(); or even a simple 'helloworld' code.
When I view the source by right-clicking.. it shows the php code.. but
why it didn't show anything in the browser ???
 
I've done all the procedures according to manual. but not working at
all.

check httpd.conf or something similar  make sure correct .php parsing

salam,
adi s. 




-- 
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] Help Needed

2002-12-26 Thread 1LT John W. Holmes
 Everything's perfect.. except my browser keep blank when I run my php
 files...

No, obviously it's not perfect because it's not working at all. Your page is
blank because ? phpinfo() ? will be evaluated as an unknown HTML tag and
come out blank.

Find another tutorial that discusses how to set up what you want and follow
it step by step.

---John Holmes...

 I juz installed a RedHat 8.0 on my machine.
 But then I have a problem in configuring Apache 2.0.4 to use PHP 4.20..
 It's preety weird.. coz there's nothing shown up in the browser when I
 run phpinfo(); or even a simple 'helloworld' code.
 When I view the source by right-clicking.. it shows the php code.. but
 why it didn't show anything in the browser ???
 
 I've done all the procedures according to manual. but not working at
 all.

 check httpd.conf or something similar  make sure correct .php parsing


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] Help Needed

2002-12-26 Thread Rick Widmer
At 02:36 PM 12/26/02 +0700, dufronte wrote:


Hi.
I juz installed a RedHat 8.0 on my machine.
But then I have a problem in configuring Apache 2.0.4 to use PHP 4.20..


Apache 2 and PHP are not ready for prime time.  If you must use Apache 2 
with PHP, you are on the bleeding edge, and should plan on helping debug 
the combination.

Certainly there are some combinations of versions and configurations that 
do work, but there are many, many more that do not.  If you have time to 
study and test Apache 2 + PHP, I'm sure your help would be welcome.

If you want it to just work, you should be using Apache 1.3.


Rick


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] Help Needed

2002-12-26 Thread dufronte
I juz solved my problems last night...
When I searched PHP.net.. I found out that PHP.4.3.ORC4 is compatible
for APACHE2 but it isn't released yet... When I installed it.. it
works... now I can use PHP in my APACHE2...

Juz for information for somebody who have the same problem like me, you
can use the PHP.4.3.ORC4 for APACHE2.. it's more stable.. I guarantee...

Download : http://qa.php.net 


--www.kapsul.org--
  DuFronte

-Original Message-
From: Rick Widmer [mailto:[EMAIL PROTECTED]] 
Sent: Friday, December 27, 2002 8:18 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Help Needed

At 02:36 PM 12/26/02 +0700, dufronte wrote:

Hi.
I juz installed a RedHat 8.0 on my machine.
But then I have a problem in configuring Apache 2.0.4 to use PHP 4.20..

Apache 2 and PHP are not ready for prime time.  If you must use Apache 2

with PHP, you are on the bleeding edge, and should plan on helping debug

the combination.

Certainly there are some combinations of versions and configurations
that 
do work, but there are many, many more that do not.  If you have time to

study and test Apache 2 + PHP, I'm sure your help would be welcome.

If you want it to just work, you should be using Apache 1.3.


Rick




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] Help Needed

2002-08-01 Thread leo g. divinagracia iii

you need a second REQUIRED parameter:

mysql_result

(PHP 3, PHP 4 )

mysql_result -- Get result data

Description

mixed mysql_result ( resource result, int
row [, mixed field])

as copied from php's doc site...

http://www.php.net/manual/en/function.mysql-result.php

Manoj Japher wrote:

 hi,
   I have started working with PHP-MySQL recently. I have been
 getting a
 warning message which i am not able to debug. Could some one  pls
 help
 me out?

 The message is
 Warning: mysql_num_rows(): supplied argument is not a valid
 MySQL
 result resource in /usr/local/apache2/htdocs/verify.php on line
 37

 The code is

 @$db=mysql_pconnect(localhost:/var/lib/mysql/mysql.sock,,);


if(!$db)
{
 echo  The Server is Busy. Please Try Later ;
 exit;
}

   mysql_select_db(userinfo);

   $query = select * from userinfo;

   $mysql_results = mysql_query($query,$db);

 line 37:$num_result = mysql_num_rows($mysql_results);

   if($num_result == 0)
{
  echo PInvalid Username or Password entered/P;
  exit;
}

 Regards,

 Manoj

 'I have miles to go before I sleep, and promises to keep'

 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

--
Leo G. Divinagracia III
[EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] HELP NEEDED! SELECT of Text Fields in MS SQL Server 7.0 Limitatio n

2001-12-16 Thread Miles Thompson

Don't have any suggestions, but have these questions been asked:

Presumably your query works just fine at the SQL Server console?

What happens - the first 8k display, and then the rest of your page appears?
Or do you get an error message? Timeout?

What do you get?

Are you hitting an array size limit? String size limit?

Can you skip over the first 8k and fetch the remaining 8k?

No answers, but some of these questions may turn up something.

Miles Thompson



At 12:47 PM 12/15/2001 -0600, Niko Spyridonos wrote:
When trying to extract the contents of a text field in MS SQL Server 7.0
with PHP 4.0, I can only get up to about 8,000 characters of text out of
them.

Has anyone achieved to pull more data using PHP and if yes how?

Thanks in advance.



Niko Spyridonos
Director of E-Business Services

Chamerlik/CompuLogic
http://www.designtech1.com/

T: (847) 679-5030 ext. 201
F: (847) 933-9413
C: (847) 980-7799

-
Chamerlik/CompuLogic is standing
strong against terrorism!


--
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]