[PHP-DB] Re: MSSQL question

2001-09-21 Thread John Lim

Just install php and enable in your php.ini file the line

extension=php_mssql.dll

And make sure this dll is in your php extension folder.

Regards, John

"Sharif Islam" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> I already have a MSSQL 7 installed in win2k with IIS. I want to install
> php. Do i need to configure anything with mssql?
> thanks
>
>
> )
>((
>   |""|-.
>   | :|/'
>  -`--'-
>



-- 
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] How to make it case sensitive?

2001-09-21 Thread David Bullock

On Fri, 21 Sep 2001 14:28:52 -0400, [EMAIL PROTECTED] (Jason Stechschulte)
wrote:

>On Fri, Sep 21, 2001 at 05:02:14PM +0100, Denny Suvanto wrote:
>> The script is just fine until I notice that the
>> username is case insensitive. So, if a member has a
>> username "andy" he can log in using 
>> "andy", "Andy", "aNdY", "andY", and so on. I also
>> notice that I can't enter a new member with username
>> "Andy", "anDY", and so on as they will duplicate the
>> existing "andy". Is this the natural behaviour of
>> MySQL or is there anyway to make it case sensitive?
>> I'm using PHP 4.0.6 & MySQL 3.23.39.
>
>You have to make the column case sensitive, binary will accomplish this.
>Something like:
>
>username varchar(20) binary

Another way to tackle the problem is to store the data into field in a set case
by running strtoupper or strtolower on the data before you store it or retrieve
it.  It will also likely require less CPU power than running a fuzzy regexp
based search.

- Dave

-- 
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] How to do this with PHP

2001-09-21 Thread Meir Kriheli

On Friday 21 September 2001 21:47, Rick Emery wrote:
> SELECT * FROM mytable LIMIT 0,5
> SELECT * FROM mytable LIMIT 6,5
> SELECT * FROM mytable LIMIT 11,5
> SELECT * FROM mytable LIMIT 16,5

It is advised to add 

ORDER BY _col_name_here_

to guarantee the order of rows retrieved (otherwise, you can't be sure about 
the order of rows returned - it could work but you shouldn't take a chance).

For more info on this check PHP builder:
http://www.phpbuilder.com/columns/rod20001214.php3

-- 
Meir Kriheli

> -Original Message-
> From: Alawi Albaity [mailto:[EMAIL PROTECTED]]
> Sent: Friday, September 21, 2001 1:44 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] How to do this with PHP
>
>
> I have a table ..
> this table have 20 record..
> I want to view this record in the 4 pages (5 record by
> page)..
> how can I do that !!
>
>


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

2001-09-21 Thread Sharif Islam


I already have a MSSQL 7 installed in win2k with IIS. I want to install
php. Do i need to configure anything with mssql?
thanks


)
   ((
  |""|-.
  | :|/'
 -`--'-


-- 
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] How to do this with PHP

2001-09-21 Thread Rick Emery

SELECT * FROM mytable LIMIT 0,5
SELECT * FROM mytable LIMIT 6,5
SELECT * FROM mytable LIMIT 11,5
SELECT * FROM mytable LIMIT 16,5

-Original Message-
From: Alawi Albaity [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 21, 2001 1:44 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] How to do this with PHP


I have a table ..
this table have 20 record..
I want to view this record in the 4 pages (5 record by
page)..
how can I do that !! 


__
Terrorist Attacks on U.S. - How can you help?
Donate cash, emergency relief information
http://dailynews.yahoo.com/fc/US/Emergency_Information/

-- 
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] How to do this with PHP

2001-09-21 Thread Alawi Albaity

I have a table ..
this table have 20 record..
I want to view this record in the 4 pages (5 record by
page)..
how can I do that !! 


__
Terrorist Attacks on U.S. - How can you help?
Donate cash, emergency relief information
http://dailynews.yahoo.com/fc/US/Emergency_Information/

-- 
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] How to make it case sensitive?

2001-09-21 Thread Jason Stechschulte

On Fri, Sep 21, 2001 at 05:02:14PM +0100, Denny Suvanto wrote:
> The script is just fine until I notice that the
> username is case insensitive. So, if a member has a
> username "andy" he can log in using 
> "andy", "Andy", "aNdY", "andY", and so on. I also
> notice that I can't enter a new member with username
> "Andy", "anDY", and so on as they will duplicate the
> existing "andy". Is this the natural behaviour of
> MySQL or is there anyway to make it case sensitive?
> I'm using PHP 4.0.6 & MySQL 3.23.39.

You have to make the column case sensitive, binary will accomplish this.
Something like:

username varchar(20) binary
-- 
Jason Stechschulte
[EMAIL PROTECTED]
--
I think it's a new feature.  Don't tell anyone it was an accident.  :-)
 -- Larry Wall on s/foo/bar/eieio in <[EMAIL PROTECTED]>

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: ELF Header problem

2001-09-21 Thread lo-tek

To begin with, ELF is a Linux executable file format, whereas .DLL denotes a
Windows dynamic link library (equivalent functionally to a .SO). looks like
youre mixing PHP components across OSes

Vipin <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
> Please check out the following error.
>
> "Unable to load dynamic library './php_imap.dll' - ./php_imap.dll:
> invalid ELF header in config.php on line 3"
>
> I have loaded the php_imap.dll at runtime using the dl() function.
> Can anyone tell me the reason for this error and how to solve it.
>
> Thanx,
> Vipin
> Samsan Exports.



-- 
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: How to test if mysql_fetch_array returns no results ?

2001-09-21 Thread Bill Blancett

Disregard the previous post. I figured out that mysql_num_rows() returns the
number of rows from the result of a SELECT query.

"Bill Blancett" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I am new to PHP so I am need someone to explain this problem to me. I am
> trying to read items from a table and store them into an array. My current
> function of choice to use is "mysql_fetch_array". The documentation says
> that it returns FALSE if there are no more rows returned, but yet when the
> query does not return a result set, It does not return anything. So the
> basic question is how do I test for a query that does not return for any
> results ? Here is some of my code below:
>
> $result = mysql_db_query ("GradAdmissions","select * from applicant where
> applicant_id = 17");
> while ($row = mysql_fetch_array ($result))
>{
> echo "applicant_id: ".$row["applicant_id"]."\n";
> echo "member_id: ".$row["member_id"]."\n";
> }
> mysql_free_result ($result);
>
> Thanks in advance
>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] sybase-ct lib, Sybase ASE 12.5, Linux

2001-09-21 Thread Carlo Borreo

Did someone succeed installing Php with sybase-ct extension, on a Linux
system containing ASE 12.5?
When compiling, it doesn't find the include, because with the new version of
ASE the are in $SYBASE/OSE/include, rather than $SYBASE/include. I moved the
include file where compiler could find it, and at linking it didn't find the
libraries (see error message at the bottom). There is no file named
"sybtcl*" in my system, what should I do?

Thanks in advance
Carlo Borreo

/bin/sh /tmp/php-4.0.6/libtool --silent --mode=link
gcc  -I. -I/tmp/php-4.0.6/ -I/tmp/php-4.0.6/main -I/tmp/php-4.0.6 -I/tmp/php
-4.0.6/Zend -I/tmp/php-4.0.6/ext/mysql/libmysql -I/opt/sybase-12.5//include 
-I/tmp/php-4.0.6/ext/xml/expat/xmltok -I/tmp/php-4.0.6/ext/xml/expat/xmlpars
e -I/tmp/php-4.0.6/TSRM  -DLINUX=22 -DUSE_HSREGEX -DUSE_EXPAT -DSUPPORT_UTF8
 -DXML_BYTE_ORDER=12 -g -O2   -o libphp4.la -rpath
/tmp/php-4.0.6/libs -avoid-version -L/opt/sybase-12.5//lib  -R
/opt/sybase-12.5//lib stub.lo  Zend/libZend.la sapi/apache/libsapi.la
main/libmain.la regex/libregex.la ext/mysql/libmysql.la ext/pcre/libpcre.la
ext/posix/libposix.la ext/session/libsession.la ext/standard/libstandard.la
ext/sybase_ct/libsybase_ct.la ext/xml/libxml.la
TSRM/libtsrm.la -ldl -lsybtcl -lintl -lcomn -lct -lcs -lcrypt -lresolv -lm -
ldl -lnsl -lresolv
/usr/bin/ld: cannot find -lsybtcl



-- 
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] How to test if mysql_fetch_array returns no results ?

2001-09-21 Thread Bill Blancett

 I am new to PHP so I am need someone to explain this problem to me. I am
trying to read items from a table and store them into an array. My current
function of choice to use is "mysql_fetch_array". The documentation says
that it returns FALSE if there are no more rows returned, but yet when the
query does not return a result set, It does not return anything. So the
basic question is how do I test for a query that does not return for any
results ? Here is some of my code below:

$result = mysql_db_query ("GradAdmissions","select * from applicant where
applicant_id = 17");
while ($row = mysql_fetch_array ($result))
   {
echo "applicant_id: ".$row["applicant_id"]."\n";
echo "member_id: ".$row["member_id"]."\n";
}
mysql_free_result ($result);

Thanks in advance



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] How to make it case sensitive?

2001-09-21 Thread Denny Suvanto

I have a web site backup with PHP& MySQL. I write a
script, so a member can log in into the member area.
I build a database for the username, password, and
some other information for the member. I set the
username (which type is varchar) as the primary key.

For the authentication scheme I use :


The script is just fine until I notice that the
username is case insensitive. So, if a member has a
username "andy" he can log in using 
"andy", "Andy", "aNdY", "andY", and so on. I also
notice that I can't enter a new member with username
"Andy", "anDY", and so on as they will duplicate the
existing "andy". Is this the natural behaviour of
MySQL or is there anyway to make it case sensitive?
I'm using PHP 4.0.6 & MySQL 3.23.39.
That's all folks! Thanks before.

Denny



Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie

-- 
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] Searching MySQL using LIKE

2001-09-21 Thread Hugh Bothwell


"Jason Wong" <[EMAIL PROTECTED]> wrote in message
news:000301c1428d$f11b3a80$[EMAIL PROTECTED]...
> The obvious first thing to do is to screen your keywords. Do not search on
> common words such as:
>
> and, if, the, in etc.

An easy way to do this is to set up an array of words
to exclude.  Then you can parse your input string and
use array_diff() to return only the non-excluded words, ie

 "",
"1" => "",
"2" => "",
"3" => "",
"4" => "",
"5" => "",
"6" => "",
"7" => "",
"8" => "",
"9" => "",
"!" => "",
"&" => "",
"\n" => "",
"\t" => "",
"." => "",
"<" => "",
">" => "",
"\\" => "",
);
$searchphrase = strtr(strtolower($searchphrase), $conv)

// Parse input string into an array of words
$use = explode(" ", $searchphrase);

// Add any other too-common words that occur to you.
$excl = array(
'i', 'you', 'he', 'she', 'it', 'am', 'is', 'be', 'are',
'to', 'from', 'if', 'the', 'this', 'that', 'in', 'of', 'at',
'a', 'an', 'and', 'or', 'not'
);

// Filter out too-common words
$use = array_diff($use, $excl);

if (count($use) == 0) {
echo "No valid search terms";
exit();
}

// The FALSE is a dummy term so I don't
// have to muck about deciding whether an
// OR is needed for each search term.
$query = 'SELECT * FROM table WHERE FALSE';
foreach($use as $term)
$query .= " OR keywords LIKE '%$term%'";

?>



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

2001-09-21 Thread Jason Wong

>Hallo everyone
>I am, as one might say, 'near yet so far'
>
>* I have a page of user subscription info generated on the fly
>* I want an administrator to check a box on each result set
>* The info from each checked result set should be inserted into
>another table (A new row/tuple for
>each user)
>
>I am currently using each form element as an array to hold x
>number of Names, Adresses etc. Where
>'x' is the number of results generated, and consequently the
>number of checkboxes generated.
>
>The processing script loops thru this and inserts only those
>results that have been checked by the
>administrator in inserted in a new row.
>
>Using $HTTP_POST_VARS and dumping that to the page displays
>(obviousely) 'array', 'array', etc.
>As each hidden form element is an array and also an
>$HTTP_POST_VARS element)
>I need some way to extract the value of each array's keys so that
>they can be used in an SQL INSERT.
>
>I'm using MySQL-3.22.32 and php4.0.3pl1
>
>Here is what I have as the processing script, but as you should be
>able to see it is immedietley
>very limiting:
>
>while (list($key,$val) = each($Name)) {
>$insertsql = "INSERT INTO $table_user (Name) VALUES ('$val')";
>$result = mysql_query($insertsql, $connection) or die(mysql_error());
>}
>
>This simply INSERTS the values in the Name array, into a new row
>for each name held in the array.
>Is it possible to somehow extend this loop or use a different kind
>of loop to insert all the array
>values in this manner?
>
>Ideally it would work like this (This is JUST to illustrate the
>point, I KNOW it won't work!!)
>
>while (list($key,$val) = each($Name,$Address,$Age,$Course)) {
>$insertsql = "INSERT INTO $table_user (Name,Address,Age,Course) VALUES
>('$valName','$valAddress','$valAge','$valCourse')";
>$result = mysql_query($insertsql, $connection) or die(mysql_error());
>}
>
>Can anyone make any suggestions that would help me here?
>Many thanks in advance!
>Russ


I'm not sure how you are naming the variables on your form but I suggest
using something like:




















Now when you receive this form you'll get all the stuff you want in one
variable, in this case $form.

To insert into the database:

while (list($key,$val) = each($form)) {
  if ($key[save] == "YES") {
$insertsql = "INSERT INTO $table_user (Name,Address,Age,Course)
  VALUES ('$key[name]', '$key[address]', 'key[age]',
'$key[course]')";
$result = mysql_query($insertsql, $connection) or die(mysql_error());
  }
}


NB code is untested, use with caution :)


hth
--
Jason Wong
Gremlins Associates
www.gremlins.com.hk
Tel: +852-2573-5033
Fax: +852-2573-5851



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

2001-09-21 Thread Rick Gardner

What are the values for your checkbox?  I would consider making the 
value the index for the corresponding element.  So
<.input type=checkbox name='approved[]' value=0> <.input type='text' 
name='name[1]' value='John Smith'>
<.input type=checkbox name='approved[]' value=1> <.input type='text' 
name='name[1]' value='Russ the Great'>
<.input type=checkbox name='approved[]' value=2> <.input type='text' 
name='name[2]' value='Somebody Else'>
<.input type=checkbox name='approved[]' value=3> <.input type='text' 
name='name[3]' value='Somebody Altogether Different'>

Then in your PHP script, you could loop through the elements of 
$approved (as the only ones appearing would be the ones checked).
$insertsql = "";
for($i=0; $i Hallo everyone
> I am, as one might say, 'near yet so far'
>
> * I have a page of user subscription info generated on the fly
> * I want an administrator to check a box on each result set
> * The info from each checked result set should be inserted into another 
> table (A new row/tuple for
> each user)
>
> I am currently using each form element as an array to hold x number of 
> Names, Adresses etc. Where
> 'x' is the number of results generated, and consequently the number of 
> checkboxes generated.
>
> The processing script loops thru this and inserts only those results 
> that have been checked by the
> administrator in inserted in a new row.
>
> Using $HTTP_POST_VARS and dumping that to the page displays 
> (obviousely) 'array', 'array', etc.
> As each hidden form element is an array and also an $HTTP_POST_VARS 
> element)
> I need some way to extract the value of each array's keys so that they 
> can be used in an SQL INSERT.
>
> I'm using MySQL-3.22.32 and php4.0.3pl1
>
> Here is what I have as the processing script, but as you should be able 
> to see it is immedietley
> very limiting:
>
> while (list($key,$val) = each($Name)) {
> $insertsql = "INSERT INTO $table_user (Name) VALUES ('$val')";
> $result = mysql_query($insertsql, $connection) or 
> die(mysql_error());
> }
>
> This simply INSERTS the values in the Name array, into a new row for 
> each name held in the array.
> Is it possible to somehow extend this loop or use a different kind of 
> loop to insert all the array
> values in this manner?
>
> Ideally it would work like this (This is JUST to illustrate the point, 
> I KNOW it won't work!!)
>
> while (list($key,$val) = each($Name,$Address,$Age,$Course)) {
> $insertsql = "INSERT INTO $table_user (Name,Address,Age,Course) 
> VALUES
> ('$valName','$valAddress','$valAge','$valCourse')";
> $result = mysql_query($insertsql, $connection) or 
> die(mysql_error());
> }
>
> Can anyone make any suggestions that would help me here?
> Many thanks in advance!
> Russ

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

2001-09-21 Thread Russ Michell

Hallo everyone
I am, as one might say, 'near yet so far'

* I have a page of user subscription info generated on the fly
* I want an administrator to check a box on each result set
* The info from each checked result set should be inserted into another table (A new 
row/tuple for 
each user)

I am currently using each form element as an array to hold x number of Names, Adresses 
etc. Where 
'x' is the number of results generated, and consequently the number of checkboxes 
generated.

The processing script loops thru this and inserts only those results that have been 
checked by the 
administrator in inserted in a new row.

Using $HTTP_POST_VARS and dumping that to the page displays (obviousely) 'array', 
'array', etc. 
As each hidden form element is an array and also an $HTTP_POST_VARS element)
I need some way to extract the value of each array's keys so that they can be used in 
an SQL INSERT.

I'm using MySQL-3.22.32 and php4.0.3pl1

Here is what I have as the processing script, but as you should be able to see it is 
immedietley 
very limiting:

while (list($key,$val) = each($Name)) {
$insertsql = "INSERT INTO $table_user (Name) VALUES ('$val')";
$result = mysql_query($insertsql, $connection) or die(mysql_error());
}

This simply INSERTS the values in the Name array, into a new row for each name held in 
the array. 
Is it possible to somehow extend this loop or use a different kind of loop to insert 
all the array 
values in this manner?

Ideally it would work like this (This is JUST to illustrate the point, I KNOW it won't 
work!!)

while (list($key,$val) = each($Name,$Address,$Age,$Course)) {
$insertsql = "INSERT INTO $table_user (Name,Address,Age,Course) VALUES 
('$valName','$valAddress','$valAge','$valCourse')";
$result = mysql_query($insertsql, $connection) or die(mysql_error());
}

Can anyone make any suggestions that would help me here?
Many thanks in advance!
Russ

#---#

  "Believe nothing - consider everything"   
  
  Russ Michell
  Anglia Polytechnic University Webteam
  Room 1C 'The Eastings' East Road, Cambridge
  
  e: [EMAIL PROTECTED]
  w: www.apu.ac.uk/webteam
  t: +44 (0)1223 363271 x 2331

  www.theruss.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] MySQL Query Weirdness

2001-09-21 Thread Rick Emery

easier solution:

 while ($line = mysql_fetch_array($result)) {
 print "\t\n\t\t".$line['first_name']."\n\t\n";
 }


-Original Message-
From: Steve Cayford [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 20, 2001 5:16 PM
To: Chris S.
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] MySQL Query Weirdness


When you use mysql_fetch_array you're actually retrieving an array with 
two copies of the value you're looking for. One is indexed by the column 
number and one indexed by the column name. So it looks like you're 
looping through them both and printing each out. You might want 
mysql_fetch_assoc (to use just the column name) or mysql_fetch_row (to 
use just the column number)

-Steve

On Thursday, September 20, 2001, at 05:02  PM, Chris S. wrote:

>
>
> Hello,
>
> I'm new at this php/mysql stuff, so go easy on my guys.
>
> I've got my query script up and working, but the problem is I'm getting 
> the
> same column printed twice on the html output.  Here is the output:
>
> Connected successfully
> Chris Chris
> Mark Mark
> Mike Mike
> Dee Dee
> etc...
>
> Here is my .php script:
>
>  $link = mysql_connect("localhost", "dbuser","dbpassword")
> or die ("Could not connect");
> print ("Connected successfully");
> mysql_select_db ("dapscores") or die ("Could not select database");
>
> $query   = "SELECT first_name FROM overall_results";
> $result  = mysql_query ($query) or die ("Query failed");
>
> // printing HTML result
>
> print "\n";
> while ($line = mysql_fetch_array($result)) {
> print "\t\n";
> while(list($col_name, $col_value) = each($line)) {
> print "\t\t$col_value\n";
> }
> print "\t\n";
> }
>
> print "\n";
>
>
>
> mysql_close($link);
> ?>
>
>
> Here is my database layout:
>
> mysql> describe overall_results;
> +---+-+--+-+-+---+
> | Field | Type| Null | Key | Default | Extra |
> +---+-+--+-+-+---+
> | Match_Date| date| YES  | | NULL|   |
> | Place | varchar(10) | YES  | | NULL|   |
> | Last_Name | varchar(20) | YES  | | NULL|   |
> | First_Name| varchar(20) | YES  | | NULL|   |
> | USPSA | varchar(10) | YES  | | NULL|   |
> | Class | char(3) | YES  | | NULL|   |
> | Division  | varchar(20) | YES  | | NULL|   |
> | PF| varchar(7)  | YES  | | NULL|   |
> | Lady  | char(3) | YES  | | NULL|   |
> | Mil   | varchar(4)  | YES  | | NULL|   |
> | Law   | varchar(4)  | YES  | | NULL|   |
> | F0r   | char(3) | YES  | | NULL|   |
> | Age   | varchar(20) | YES  | | NULL|   |
> | Match_Pts | float   | YES  | | NULL|   |
> | Match_percent | float   | YES  | | NULL|   |
> +---+-+--+-+-+---+
>
> If I run the query from mysql>, it works fine, just the HTML output 
> shows
> the double column thing.  Is this a database problem?  I've tried 
> different
> variations of my script and I get the same output each time.
>
> Thanks
>
> --
> Chris S.
> [EMAIL PROTECTED]
> PGP 0xDA39672B
>
>
> --
> 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 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: RE: [PHP-DB] Searching MySQL using LIKE

2001-09-21 Thread Russ Michell

Try:

REGEXP 'keyword?';   //Matches Zero or one instances of 'keyword'
REGEXP 'keyword+';   //Matches One or more instances of 'keyword'
REGEXP 'keyword*';   //Matches Zero or more instances of 'keyword'

Cheers.
Russ

 ';
On Fri, 21 Sep 2001 04:14:47 -0700 Ralph Guzman <[EMAIL PROTECTED]> wrote:

> Postfix Users,
>e need to
> try and help out in any way I can. So here goes:
> 
> Jord,
>  
> Try using REGEXP rather than LIKE. So try something like this:
> 
> SELECT * FROM table WHERE keywords REGEXP '%keyword%';
> 
> If this does not work I may have the wrong string pattern, if so, do a
> search on REGEXP on the mySQL manual: http://www.mysql.com/doc/. I'm sure
> they have examples on using REGEXP.
> 
> Good Luck.
> 
> -Original Message-
> From: Jordan Elver [mailto:[EMAIL PROTECTED]]
> Sent: Friday, September 21, 2001 9:03 AM
> To: MySQL Mailing List; PHP DB Mailing List
> Subject: [PHP-DB] Searching MySQL using LIKE
> 
> Hi,
> I'm cross posting this because it's applicable to both list ;-)
> 
> I have a table which contains a field called Keywords. The field typically
> contains something similar to this "rubbish bins trash"
> 
> I want to search this field and I'm having trouble. If someone enters "I
> need
> bins" then the the result will not be found.
> 
> I started off by using SELECT * FROM table WHERE keywords LIKE '%keyword%',
> but that doesn't work if you type in more than just bins. So then I tried
> splitting the words entered on a space and searching for each of them like
> this SELECT * FROM table WHERE keywords LIKE '%keyword1%' OR keywords LIKE
> '%keyword1%'. But that returns loads of results because a lot of words
> contain "is" or "it" etc.
> 
> Can anyone help me with this one, I'm not sure what to try next?
> 
> Cheer,
> 
> Jord
> --
> Jordan Elver
> Web Developer
> The InternetOne UK Ltd
> 
> --
> 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]
> 

#---#

  "Believe nothing - consider everything"   
  
  Russ Michell
  Anglia Polytechnic University Webteam
  Room 1C 'The Eastings' East Road, Cambridge
  
  e: [EMAIL PROTECTED]
  w: www.apu.ac.uk/webteam
  t: +44 (0)1223 363271 x 2331

  www.theruss.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] Re: cross tab with mssql

2001-09-21 Thread amtd

Your can use ODBC.

"Sommai Fongnamthip" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
> I was used MS Access to make cross tab query with MS SQL.  How could I do
> this with PHP?  I was used syntax of MySQL but It did not work.
>
> Thank you,
> SF
>
> This is an example data:
> Customer#Bill date  Bill amount
> ---
> A12345   21/9/20011000
> B56789   21/9/20011000
> A12345   22/9/20011000
> A12345   23/9/20011000
> B56789   23/9/20011000
>
> This is the result I need.
> Customer#21/9/2001  22/9/2001 23/9/2001
> ---
> A123451000   1000  1000
> B567891000 1000
>



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