[PHP-DB] Error with in_use() from Beginning PHP4 book.

2001-08-25 Thread sam

[Please reply to: [EMAIL PROTECTED], thanks...]

Hi Wrox guys and all,

Can anyone help me out on this??

I've been using this code for quite some time now. I got it from the
"Beginning PHP4 by Choi, Kent, Lea, Prasad, and Ullman". All those times, I
don't get any errors UNTIL tonight! :(

I am now getting this error message:
"Warning: Supplied argument is not a valid MySQL result resource in
c:\nusphere\apache\htdocs\domainfolder\register.php on line 17"

Below is the code (FOUND ON BEGINNING PHP4 - PAGE 469):

function in_use($username){
 global $user_tablename;

 $query = "SELECT username FROM $dbuser WHERE username = '$username'";
 $result = mysql_query($query);
 if(!mysql_num_rows($result)) return 0; // this is the line 17.
 else return 1;
}

note: I actually just substituted the $userid variable with $username.

What it does is to compare the username to that found on the userprofile
table and if it did not find any, it will return false (0) but if there's an
existing entry of the queried username, the function will return true. It
will then be compared using a condition statement where the registrant will
be prompted to change the username if the username is already in use. The
whole register.php page it was used is from PAGE 468 to 472. Am I missing
something here?

Does this have anything to do with updated MySQL parser? I am now using
MySQL version 3.23.36.

Can anyone help me get around this one. I really need help on this due to
time constraints. :)

Please help!!!

thanks a lot.

Sam
Netfuze Hypermedia Designs



-- 
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: Mysql to CSV

2001-08-25 Thread Thomas Spellman

Check the PHP Classes site, I think I remember seeing one there. 

http://phpclasses.upperdesign.com/browse.html


-Original Message-
From: Higgy [mailto:[EMAIL PROTECTED]]
Sent: Saturday, August 25, 2001 4:51 AM
To: [EMAIL PROTECTED]
Subject: Mysql to CSV


Hi,
Does any one know of a script that will do this. I can use the phpadmin
program,  however I simply need a script that will do it after one click.

Stephen Higgins




-- 
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] Error with in_use() from Beginning PHP4 book.

2001-08-25 Thread Vijay Anand


how to access MS Access database using adodb in unix

 




--
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] Error with in_use() from Beginning PHP4 book.

2001-08-25 Thread Paul Burney

on 8/25/01 12:11 PM, sam at [EMAIL PROTECTED] wrote:

> 
> 
> Hi Wrox guys and all,
> 
> Can anyone help me out on this??
> 
> I've been using this code for quite some time now. I got it from the
> "Beginning PHP4 by Choi, Kent, Lea, Prasad, and Ullman". All those times, I
> don't get any errors UNTIL tonight! :(
> 
> I am now getting this error message:
> "Warning: Supplied argument is not a valid MySQL result resource in
> c:\nusphere\apache\htdocs\domainfolder\register.php on line 17"
> 
> function in_use($username){
> global $user_tablename;
> 
> $query = "SELECT username FROM $dbuser WHERE username = '$username'";
> $result = mysql_query($query);
> if(!mysql_num_rows($result)) return 0; // this is the line 17.
> else return 1;
> }

Is that the code for the function exactly?  If so, where is $dbuser set?  If
it's set outside the function, you need to make it a global

global $user_tablename,$dbuser;

> Does this have anything to do with updated MySQL parser? I am now using
> MySQL version 3.23.36.

Possibly if the version of PHP that you are using was linked to old versions
of the MySQL headers.  You may need to recompile PHP.

Sincerely,

Paul Burney

++
Paul Burney
Webmaster && Open Source Developer
UCLA -> GSE&IS -> ETU
(310) 825-8365
<[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] Error with in_use() from Beginning PHP4 book.

2001-08-25 Thread sam



Hi Wrox guys and all,

Can anyone help me out on this??

I've been using this code for quite some time now. I got it from the
"Beginning PHP4 by Choi, Kent, Lea, Prasad, and Ullman". All those times, I
don't get any errors UNTIL tonight! :(

I am now getting this error message:
"Warning: Supplied argument is not a valid MySQL result resource in
c:\nusphere\apache\htdocs\domainfolder\register.php on line 17"

Below is the code (FOUND ON BEGINNING PHP4 - PAGE 469):

function in_use($username){
 global $user_tablename;

 $query = "SELECT username FROM $dbuser WHERE username = '$username'";
 $result = mysql_query($query);
 if(!mysql_num_rows($result)) return 0; // this is the line 17.
 else return 1;
}

note: I actually just substituted the $userid variable with $username.

What it does is to compare the username to that found on the userprofile
table and if it did not find any, it will return false (0) but if there's an
existing entry of the queried username, the function will return true. It
will then be compared using a condition statement where the registrant will
be prompted to change the username if the username is already in use. The
whole register.php page it was used is from PAGE 468 to 472. Am I missing
something here?

Does this have anything to do with updated MySQL parser? I am now using
MySQL version 3.23.36.

Can anyone help me get around this one. I really need help on this due to
time constraints. :)

Please help!!!

thanks a lot.

Sam
Netfuze Hypermedia Designs


-- 
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] Trouble Shooting PHP mysql script

2001-08-25 Thread Armando Cerna

Could someone please help me with this it doesn't evaluate all the if 
statements it just displays everything

Thanks in advance the script is attached.

Armando


-- 
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: Can DBA(Database Abstract) function can work under Win2k?

2001-08-25 Thread Hugh Bothwell


"Hugh Bothwell" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> "Donald Fei" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > My PHP runs under:
> >  Windows 2000 Professional + Apache/1.3.20 + PHP4.0.6 + MySql3.23.32
> > when i compile the following code:
> >   > $db=dba_open("database.db","c","db2");
> > ?>
> > There is the error:
> > Fatal error: Call to undefined function: dba_open() in
> > D:\Inetpub\WebSite/dba_test.php on line 2
> > Thank you!
>
> make sure the line 'extension=php_dba.dll' is uncommented
> in php.ini

... and if you uncomment it, you have
to restart the web server become it
becomes effective.



-- 
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: Can DBA(Database Abstract) function can work under Win2k?

2001-08-25 Thread Hugh Bothwell


"Donald Fei" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> My PHP runs under:
>  Windows 2000 Professional + Apache/1.3.20 + PHP4.0.6 + MySql3.23.32
> when i compile the following code:
>   $db=dba_open("database.db","c","db2");
> ?>
> There is the error:
> Fatal error: Call to undefined function: dba_open() in
> D:\Inetpub\WebSite/dba_test.php on line 2
> Thank you!

make sure the line 'extension=php_dba.dll' is uncommented
in php.ini



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




[PHP-DB] Mysql to CSV

2001-08-25 Thread Higgy

Hi,
Does any one know of a script that will do this. I can use the phpadmin
program,  however I simply need a script that will do it after one click.

Stephen Higgins



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

2001-08-25 Thread Guilherme Bresser

Thank's Hugh!


"Hugh Bothwell" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> "Guilherme Bresser" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I have one problem.. TopSpeed don't support ODBC..
> > :-\
>
> This is the only method I've seen for languages other than Clarion.
> http://www.softclaim.com/odbc_interface.htm
>
> If there ARE any other methods, I'd love to hear about them!
>
>



-- 
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] Variables in MySQL Insert Queries

2001-08-25 Thread Howard Picken

You've created the query but haven't actually run the query.

i.e.

  $result = mysql_query($sql);

I'm new to this but I think that's what you're problem is.

Howard

-Original Message-
From: plague [mailto:[EMAIL PROTECTED]]
Sent: Friday, 24 August 2001 3:57 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Variables in MySQL Insert Queries


I am using this code to connect to my database and insert form data from a
user:

$connect = mysql_connect("myhost","user","pass") or die (" not connected");
@mysql_select_db("dbname");
$sql="INSERT INTO tablename
(id,first,last,age,email,sfuser,sfship,icq,ac,loca,ref)
Values(,`$first`,`$last`,'$age',`$email`,`$sfuser`,`$sfship`,`$icq`,`$ac`,`$
loca`,`$ref`)";
echo (mysql_affected_rows()?"success":"failure");
mysql_close($connect);

The script returns "success" except for it doesn't insert the data ( from a
form ).

The age column is BLOB, not INT.

I would really appreciate the help of someone, as this has really stumped
me.

Thanks,

plague



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