[PHP-DB] PHP tips to make your life easier

2002-04-24 Thread Adam Royle
Hello everybody, There are some techniques which I use that come in REALLY handy when writing PHP (or even ASP). I will just go through them here briefly. Any questions? Email me. 1. Keep a php file (lib.php) inside a 'code' folder in a directory for every site you work on (depending on secur

[PHP-DB] Sybase -> MSSQL Server 2000

2002-04-24 Thread tbrownridge
PHP.NET indicates that to connect to MSSQL Server, from Linux use Sybase. I've installed Sybase, PHP and Apache and everything works well on my Linux server when I connect to the Sybase test database. When I try to connect to my MS SQL server, I get this... sybase$ isql -S mssql-server -U userna

Re: [PHP-DB] Weird Windows SQL

2002-04-24 Thread Michael K. Dolan Jr.
I can create new databases if I create them from the command line logging into mysql as root. However, I'm new to the GUI and I guess I would like to login to the GUI as root. Do you know how to do this? - Original Message - From: "Peter Lovatt" <[EMAIL PROTECTED]> To: "Michael K. Dolan

RE: [PHP-DB] Weird Windows SQL

2002-04-24 Thread Peter Lovatt
have you set up permissions for the user you are connecting as? see GRANT in the MySql manual. The test bit is a default setting for users with no privileges (from my slightly rusty memory) HTH Peter --- Excellence in internet and open source softwar

[PHP-DB] Weird Windows SQL

2002-04-24 Thread Michael K. Dolan Jr.
Hi, I just installed MySQL on Windows XP. The winmysqladmin GUI only allows me to create databases that start with "test". So, I can create a database called "testmydata" but I cannot create a database named "mydata". This is driving me nuts. Any ideas? Thanks, Mike

Re: [PHP-DB] PROBLEM: localhost <-> localhost.localdomain

2002-04-24 Thread php3
Addressed to: "Erich Fuchs" <[EMAIL PROTECTED]> [EMAIL PROTECTED] ** Reply to note from "Erich Fuchs" <[EMAIL PROTECTED]> Wed, 24 Apr 2002 20:04:11 +0200 > i have a strange problem, with PHP 4.2.0, RedHat 7.1, mySQL Server version > 3.23.36, PHP internal mySQL Client running on tw

[PHP-DB] PROBLEM: localhost <-> localhost.localdomain

2002-04-24 Thread Erich Fuchs
Hello Freaks, i have a strange problem, with PHP 4.2.0, RedHat 7.1, mySQL Server version 3.23.36, PHP internal mySQL Client running on two Servers with exactly the same Settings and Compilations. Now i have a DB User with rights on host "localhost" on one server i can connect normall, the secon

RE: [PHP-DB] Re: WELCOME to php-db@lists.php.net

2002-04-24 Thread Ryan Jameson (USA)
Interesting challenge. I tend to write TSQL more these days so this may not work on MySQL but the subquery approach should give you an idea of the method. I just typed this up so it may not even work! :-) select min(stopped) as Stopped,Started, (Started-min(stopped)) as Duration from (select

Re: [PHP-DB] User getting superuser access. ack!

2002-04-24 Thread szii
It looks like $indinfo *may* get set to FALSE and passed back on a failed query. I'd vardump() the $username in findLoginType() and make sure it's going in correctly, and that your output is not FALSE coming out. I also seem to remember something about "==" not being an equality operator for s

[PHP-DB] Re: determine the primary key after adding a row to a table (mysql)

2002-04-24 Thread J. Wharton
I encountered something similar. Here is a snippet of code: $tdate=date("Y\\-m\\-d"); $time=date("G\\:i\\:s"); $query="insert into trackinginfo (IP_Address, username, date, Time, Processed, CommentFlag) values ('$REMOTE_ADDR', '$username', '$tdate', '$time', 'N', '$commentExists')"; mysql_quer

[PHP-DB] Re: WELCOME to php-db@lists.php.net

2002-04-24 Thread Jeff Hibser
Hello, I am relatively new to php, and have a question regarding polling a mysql database and defining groups of data: Say I have a table that looks like this: Time| Speed 1016278580 | 0 1016278582 | 0 1016278584 | 0 1016278586 | 3 1016278588 | 7 1

[PHP-DB] ODBC problems in PHP 4.2

2002-04-24 Thread Ryan Jameson (USA)
If this is easy for anyone could someone verify that: odbc_fetch_row($rs,0); ...does not reset the result set in version 4.2? From what I can tell it doesn't work at all. I want to be certain that we cannot upgrade to 4.2. If someone has another way to reset an ODBC result set I'd love to he

Re[2]: [PHP-DB] Search tutroial

2002-04-24 Thread Julie Meloni
JD> By the way SELECT uid, id, image, iname, quantity, type, user where it shows JD> below that user isn't in the query- it is there in my editor. >> $query = "SELECT uid, id, image, iname, quantity, type FROM >{$config["prefix"]}_shop WHERE iname = $shopsearch"; The first problem would be that

Re: [PHP-DB] Search tutroial

2002-04-24 Thread Dan Brunner
Hello!! Use LIKE in your WHERE clause... You can also more then when Field Example. $query = "SELECT uid, id, image, iname, quantity, type FROM {$config["prefix"]}_shop WHERE iname LIKE = '%$shopsearch% ORDER BY iname'"; $ret = mysql_query($query); while(list($quantity

Re: [PHP-DB] Search tutroial

2002-04-24 Thread Jennifer Downey
By the way SELECT uid, id, image, iname, quantity, type, user where it shows below that user isn't in the query- it is there in my editor. I just forgot to put it in before sending. Jennifer "Jennifer Downey" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > This

Re: [PHP-DB] Search tutroial

2002-04-24 Thread Jennifer Downey
This is basically what I am trying to do if($search) { $query = "SELECT uid, id, image, iname, quantity, type FROM {$config["prefix"]}_shop WHERE iname = $shopsearch"; $ret = mysql_query($query); while(list($quantity)=mysql_fetch_row($ret)) $name = $row['user']; echo $name; }else{

Re: [PHP-DB] Search tutroial

2002-04-24 Thread Julie Meloni
JD> Would someone kindly point me to a tutorial on designing a search script for JD> mysql db. JD> I have tried to build one but can't get anywhere with it. Well, that would depend on what and how you are searching, your table structure, etc. Essentially, every SELECT query is a "search". If y

Re: [PHP-DB] Search tutroial

2002-04-24 Thread Dan Swensen
Getting a search function running perplexed me, too, until I looked at the MySQL docs. With the Full-Text Search function I got a search function working in minutes. http://www.mysql.com/doc/F/u/Fulltext_Search.html Watch out for the weird bug that ignores duplicate rows, though. It can make

[PHP-DB] Search tutroial

2002-04-24 Thread Jennifer Downey
Hi all, Would someone kindly point me to a tutorial on designing a search script for mysql db. I have tried to build one but can't get anywhere with it. Thanks Jennifer -- The sleeper has awaken --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.co

Fw: [PHP-DB] determine the primary key after adding a row to a table (mysql)

2002-04-24 Thread Richard Emery
$lastid = mysql_last_id(); returns auto_increment from inserted record - Original Message - From: CJ <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, April 24, 2002 4:19 PM Subject: [PHP-DB] determine the primary key after adding a row to a table (mysql) is there any way to

[PHP-DB] determine the primary key after adding a row to a table (mysql)

2002-04-24 Thread CJ
is there any way to determine the primary key of a row after it's added to a table in mysql? i need to do this because i have another table which requires the id from one table as a foreign key. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub

RE: [PHP-DB] redirect a page

2002-04-24 Thread John Hughes
If you really want to redirect and not just display a message that no records were found, then this will work: $num = mysql_numrows($result); if ($num == 0) { header("Location: sorry.php"); exit; } ELSE { while ... --- "Rankin, Randy" <[EMAIL PROTECTED]> wrote: > Nato, > > Try somethi

Re: [PHP-DB] User getting superuser access. ack!

2002-04-24 Thread J. Wharton
here's the code for findLoginType($username): function findLoginType($username) { $dbusername="foo"; $password="bar"; DBConnect($dbusername, $password); //sets up a connection with the mysql database $userquery="select * from users where username='$username'"; $theresultsplz=mysql_query($us

RE: [PHP-DB] redirect a page

2002-04-24 Thread Rankin, Randy
Nato, Try something like this: $num = mysql_numrows($result); if ($num == 0) { echo "There were no records found."; } else while ... -Original Message- From: Natividad Castro [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 24, 2002 11

[PHP-DB] redirect a page

2002-04-24 Thread Natividad Castro
Hi to all, I have a search form where users can search for a specific record; up to now is working fine, but what I would like to do is: if the record is not found, redirect them to another page that says that record was not found. Can anybody tell me how to do this? I already tried using this sta

Re: [PHP-DB] mysql tables

2002-04-24 Thread Miles Thompson
Read the MySQL docs and find out! MT At 10:27 AM 4/24/2002 +0300, Marius Ursache wrote: >hi > >how many columns can have a mysql table? > >tnx > >-- > Marius Ursache (3563 || 3494) > >\|/ \|/ >"@'/ ,. \`@" >

[PHP-DB] mysql tables

2002-04-24 Thread Marius Ursache
hi how many columns can have a mysql table? tnx -- Marius Ursache (3563 || 3494) \|/ \|/ "@'/ ,. \`@" /_| \__/ |_\ \__U_/ -- PHP Database Mailing List (http://www.php.net/)