Re: [PHP-DB] Yet more strings

2001-03-21 Thread Johannes Janson
Hi, I'm not quite sure but try to play a bit with the '".$row[...]."' part. that looks too much. leave out the "" and/or the period. good luck Johannes ""Mick Lloyd"" [EMAIL PROTECTED] schrieb im Newsbeitrag

Re: [PHP-DB] mysql privilege

2001-03-25 Thread Johannes Janson
Hi, to do this you'd need to be a quite priviledged user. in order to create users you'll need acces to the user-table of mysql. not likely to be given to a "normal" user. developing on your home pc, well... you need GRANT to grant priviledges to any user. also not likely to be given to a user.

Re: [PHP-DB] Take out one Data and show it in page

2001-03-28 Thread Johannes Janson
Hi, hte first part after WHERE is the column name of your db. if you want to search with name as a criteria you write: selelct name, nickname from table where name=$name; johannes "Naga Sean" [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I had a

Re: [PHP-DB] Auto_Increment

2001-03-29 Thread Johannes Janson
Hi, well usually yuto_increment is used on ID fields. then depending on how many rows your table has tinyint (up to 255; 1k), smallint (up to 65535; 2k) mediumint (up to 16777215; 3k) int (up to 4294967295, 4k). Johannes "Ben Cairns" [EMAIL PROTECTED] schrieb im Newsbeitrag

Re: [PHP-DB] duplicate a table

2001-04-03 Thread Johannes Janson
Hi, just install phpMyAdmin which has a feature to duplicate tables structure only or structure and data. ""McShen"" [EMAIL PROTECTED] schrieb im Newsbeitrag 9aak89$ruv$[EMAIL PROTECTED]">news:9aak89$ruv$[EMAIL PROTECTED]... how do i duplicate a table? i tried create table refer2 select *

Re: [PHP-DB] msql_numrows HELP please !!!

2001-04-06 Thread Johannes Janson
Hi, ?php $dbhost = "yourhost"; $dbuser = "youruser"; $dbpass = "yourpassword"; $dbname = "name_of_DB"; $connection = mysql_connect("$dbhost, $dbuser, $dbpass") or die ("can't connect"); $database = myslq_select_db($dbname) or die ("can't select DB"); $result = mysql_query("SELECT * FROM

Re: [PHP-DB] headers

2001-04-07 Thread Johannes Janson
Hi, you can't have ANY output whatsoever before adding a header. Even whitespaces before the opening ?php-tag are not possible. You also could turn "output_buffering" "ON" in your php.ini. But your ISP has to have them same setting and I don't know about disadvantages. So go with the first

[PHP-DB] link_identifier in mysql_query

2001-04-10 Thread Johannes Janson
Hi, just a theoretical question: is it neccessary/useful/good to specify the link_identifer for a query if I include an ypplication file where the link is opened in every file. quote: If link_identifier isn't specified, the last opened link is assumed. If no link is open, the function tries to

Re: [PHP-DB] Checking database if already exsists

2001-04-16 Thread Johannes Janson
Hi, assuming you have unique passwords. $result = mysql_query("SELECT COUNT(*) AS used FROM userTable WHERE passowrd=$password"); $exists = mysql_fetch_object($result); if ($exists-used) { display error that pswd is already in use } If there is an entry in your DB with the password

Re: [PHP-DB] Permanent Cookies

2001-04-16 Thread Johannes Janson
Hi, could it be the setting of cookie_lifetime in your php.ini? or the coolie_path? just two thoughts cheers Johannes ""Lisa Elita"" [EMAIL PROTECTED] schrieb im Newsbeitrag 004f01c0c4df$1bd0e540$69fc2bca@hadinata">news:004f01c0c4df$1bd0e540$69fc2bca@hadinata... I tried to use cookies with

Re: [PHP-DB] Supplied argument is not a valid MySQL result resource...

2001-04-17 Thread Johannes Janson
Hi, you usually get the error if your query is wrong and you try to call mysql_fetch_array in a while loop. It's easier if you post the relevant lines of code but I'd say there is something wrong with your query. Johannes ""Klaus Haberkorn"" [EMAIL PROTECTED] schrieb im Newsbeitrag

Re: [PHP-DB] A bit of help with a query needed.

2001-04-17 Thread Johannes Janson
Hi, which part is not working? Put a "or die(mysql_error())" behind your queries to see which one produces an error. like this: $result = mysql_query("SELECT * FROM ships ORDER BY ship",$db) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { If ($result) { $id

Re: [PHP-DB] Supplied argument is not a valid MySQL result resource...

2001-04-17 Thread Johannes Janson
Hi, i don't get that. Examlpe: tablename: test , entry: id 001; name: John Doe $result = mysql_query("SELECT * FROM test"); $row = mysql_fetch_whatever($result); // everything ok $result = mysql_query("SELECT * FROM tet"); $row = mysql_fetch_wahtever($result); // Warning: Supplied arggument

Re: [PHP-DB] Error messge regarding session variables

2001-04-17 Thread Johannes Janson
Hi, cookies are sent as header information. This means you can't send any output (html-tag, whitespaces before ?php) at all before sending cookie/header information. As your error message tells you the output already started in line 4. Move the cookie-part from line 6 to the beginning and it

Re: [PHP-DB] A bit of help with a query needed.

2001-04-17 Thread Johannes Janson
Hi, $result2 = mysql_query("SELECT * FROM convicts WHERE ship = '$id' ORDER BY convict",$db); $row = mysql_fetch_array($result2) // ! you are missing a ";" this is where you get the parse error from! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe,

Re: [PHP-DB] PHP + Interbase

2001-04-17 Thread Johannes Janson
Hi, check the relevant configure-flag for interbase. most likely to be something like --with-interbase. just type ./configure --help |more and you'll get a lng list of options. Johannes [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Quiero instalar

Re: [PHP-DB] How to redirect a user to main page once I capture his info in a form?

2001-04-18 Thread Johannes Janson
Hi, you have output in line 42. any html stuff. You have to send haeder information before any output. If you capture the info via a form you can make a seperate capturing script (not $PHP_SELF) to enter the info into a DB and at the end of this -after successfully inserting the data- redirect

Re: [PHP-DB] Variables and DB

2001-04-19 Thread Johannes Janson
how about posting the code? or describe the problem a bit closer. Johannes "Rui Machado" [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello I'm writting a registration form with connection to mysql DB, but I have a problem in the last step, I can't

Re: [PHP-DB] Sessions w/ Communicator 4.7 Problem

2001-04-19 Thread Johannes Janson
Hi, $test = "The session data was transferred."; echo "Click this link: a href=\"test2.php?".SID."\"test2.php/a"; change this to a href=\"test2.php?id=$PHPSESSID\"test2.php/a"; you need to specify a variable name first behind the ?. It worked for me on NS 4.75 Johannes -- PHP Database

Re: [PHP-DB] Help with Apache+PHP4 on Windows ME

2001-04-20 Thread Johannes Janson
Hi, Does anybody know a solution? I am willing to show you my httpd.conf and php.ini if you like. httpd.conf would be helpful. only the relevant stuff like AddTpye application. Johannes -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: [PHP-DB] Loading jpg (etc)

2001-04-21 Thread Johannes Janson
Hi, why storing the pictures in the db. just store the link to it. just a thought Johannes "Sharmad Naik" [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, I wanted to know how to store and retrive images like jpeg,bmp from database.I have a table

Re: [PHP-DB] calling a column into a popup

2001-04-22 Thread Johannes Janson
Hi, let me get this right. What I understood is the following: 1. Your admin page where you enter the information of a company 2. A Page with a drop-down list where all the company names are listed. (These names should then be linked to an information page with more info?) 3. A page where

Re: [PHP-DB] nested ifs?

2001-04-22 Thread Johannes Janson
Hi, This is the code that I have so far (please note, it is within a function)... any ideas of how I can make it work? this arouses the assumption that is doesn't work. Did you get errors? And could you supply more information about your database relations especially about the one of orders

Re: [PHP-DB] calling a column into a popup

2001-04-23 Thread Johannes Janson
So a certain company is previously selected? And then you want to populate the form with the info of the company? to do this link the menu with a onChange action to a display page. But I'm not sure if I get the layout. Could you describe it again? Cheers Johannes Beckie Pack [EMAIL

Re: [PHP-DB] Variable passing

2001-04-24 Thread Johannes Janson
You can output the passed varibles from the previous page in an input type=hidden in the form of the following page. Johannes Brinzoi Constantin Aurelian [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi ! Here is the problem: I got 8 pages, shown one

Re: [PHP-DB] getting rows from multiple tables into a single array ? (newbie, mysql)

2001-04-24 Thread Johannes Janson
Hi, $sql4=select * from quicktimes, other_images, storyboards, where quicktimes.spot_id, other_images.spot_id, storyboards.spot_id = \$spot_id\ order by date_posted desc; this should be: ...WHERE quicktimes.spot_id = '$spot_id', other_images.spot_id = '$spot_id' storyboards.spot_id =

Re: [PHP-DB] How to randomly select data in a field. Please help newbie.

2001-04-30 Thread Johannes Janson
Hi, you could do the random selection in MysSQL if you use it using a query like this. SELECT FieldWithURL FROM YourTable ORDER BY RAND() LIMIT 0,1; This will give you a random field. If you want more fields you have to set different values for the limit. Like LIMIT 0,5 for the first 5 row.

Re: [PHP-DB] How to randomly select data in a field. Please help newbie.

2001-05-02 Thread Johannes Janson
Message - From: Johannes Janson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, April 30, 2001 6:56 PM Subject: Re: [PHP-DB] How to randomly select data in a field. Please help newbie. Hi, you could do the random selection in MysSQL if you use it using a query like this.

Re: [PHP-DB] MySq lType and PHP??

2001-05-11 Thread Johannes Janson
Hi, I'm trying to get MySql type of a field (as string) into a php script. sometime the answer is easier as you think: mysql_field_type(link_identifier); Johannes -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

Re: [PHP-DB] Newbie: IF statement

2001-05-14 Thread Johannes Janson
Hi, I have tried these if statements, but without luck: if ($Page='') { $Page=homepage } you use only one = So you assign or '' or null to $page. use if ($page == ) instead. hope it helps Johannes -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL

Re: [PHP-DB] do table alias's work in PHP?

2001-05-16 Thread Johannes Janson
Hi, The following statement will not work: $sql = select * from sometable t1, sometable t2 where t1.field1 = t2.field2; do you get an error? It should work. Johannes -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

Re: [PHP-DB] Detect OS

2001-05-16 Thread Johannes Janson
Hi, How can I detect client's OS/platform with PHP? (Win, Mac, etc.) with PHP_OS. $os = PHP_OS; See Chapter 8 - Constants of the manual. Johannes -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

Re: [PHP-DB] do table alias's work in PHP?

2001-05-16 Thread Johannes Janson
I'm not sure but couldn't it really be that this is due to the MySQL version? PHP is just passing a string which is then executed by MySQL. I think I recall having no problems with aliases. I don't quite remember which version it was but I think it was 3.23.*. Now I am using a shareware version

Re: [PHP-DB] Pick a row, any row.

2001-05-17 Thread Johannes Janson
Hi, How can I pick a random row? SELECT * FROM table ORDER BY RAND() LIMIT 0, 1; I'm not really sure but it worked with order by rand. Check the manual on that if it doesn't work hope it helps Johannes -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL

Re: [PHP-DB] Help With Getting Values Please!

2001-05-23 Thread Johannes Janson
Hi, $sql2 = SELECT ServiceDes FROM ServiceTypes WHERE ServiceID = $serviceid; put single quotes around $serviceid. $service_type = mysql_result($sql2, 1); I might be perpetuating the spreading of rumors but I've heard and read somewhere that mysql_query() is supposed to be better in the

Re: [PHP-DB] error

2001-05-23 Thread Johannes Janson
Hi, Warning: MySQL Connection Failed: Unknown MySQL Server Host '0f2scom' (2) in /web/sites/139/gamie/www.game-boy-advance.f2s.com/addartikel.php on line 22 Unable toconnect to database [...snip...] mysql_connect(db.game-boy-advance.f2s.com,*,**) or die(Unable toconnect to

Re: [PHP-DB] PHP and Access

2001-05-24 Thread Johannes Janson
Hi, I normally work PHP/MySQL but now I have a customer that is adamant about keeping their data in an Access DB. you could work around it by using an odbc connection from Access to MySQL. So the administration is still done via Access but actually it is a MySQL DB. If you're interested see

Re: [PHP-DB] Header error

2001-06-29 Thread Johannes Janson
Hi, [...] Warning: Cannot add header information - headers already sent by (output started at /home/thesis/public_html/registro.php:2) in /home/thesis/public_html/registro.php on line 80 [...] you can't have any output before calling header(). Output is any HTML or even whitespaces before

Re: [PHP-DB] What does this error mean?

2001-06-29 Thread Johannes Janson
Hi, [...] Warning: fopen(logs/993700800.log,w+) - Permission denied in /home/sites/site20/users/guide/web/counter.php on line 28 are you sure you have the rights to access the file? Warning: Supplied argument is not a valid File-Handle resource in

[PHP-DB] Re: Login Help

2001-07-09 Thread Johannes Janson
Hi, [...] Now, if i hit enter again it will say: Please fill out all fields to proceed. Sorry, username is already taken, please choose another. There seems to be a problem with the database. So this is the problem? [...] Here is my code:

[PHP-DB] Re: problem with form

2001-07-10 Thread Johannes Janson
Hi, hope anyone has an idea on how to fix this... form input type=submit name=Submit value=Submit Request OnClick=submit.php class=button input type=submit name=Edit value=Edit Request OnClick=edit.php class=button /form you could give the form one action and then check on the following

[PHP-DB] Re: MySQL Error

2001-07-10 Thread Johannes Janson
Hi, Dear Experts When ever i try to run MySQL under linux it gives me following error ERROR 2002 : can't connect to local MYSQL server through socket '/var/lib/mysql.sock' (111) this is with PHP isn't it? can you log in the monitor and then type SHOW VARIABLES. A long list will be

[PHP-DB] Re: PHP redirect?

2001-08-02 Thread Johannes Janson
Hi, I have a form and based off of this form if my user selects option a then I want them to be redirected to another page. If they select option B then I want to continue with my php scrips as it does now. Does any one have any ideas on how I can accomplish this? use the header() function

[PHP-DB] Re: SQL Error

2001-08-02 Thread Johannes Janson
Hi, [...] Any ideas? $add_contact_sql = INSERT INTO $table_name (ContactID, FirstName, LastName, Title, WorkPhone, HomePhone,Mobile,EmailName,Birthday,CompanyID) VALUES ('', '$FirstName', '$LastName', '$Title', '$WorkPhone', '$HomePhone', '$Mobile', '$EmailName', '$Birthday',

[PHP-DB] Re: Array and ID

2001-08-03 Thread Johannes Janson
Hi, I have a drop-down menu that has been prepopulated with an array from a column name CompanyName. What I need to do is take the CompanyName lookup the CompanyID in the company table and insert the CompanyID into a row in a table called contacts with a CompnayID column. [...] Is this a

[PHP-DB] Re: semi newbie Q

2001-08-09 Thread Johannes Janson
Hi, Here is a quick question. Cane the mail() function handle file attachments? I couldnt find anything like that on the PHP reference but maybe someone knows out there. If not does anyone have any simple scripts that will allow me to do this? I think it doesn't. Check e.g

[PHP-DB] Re: Show abbreviated article

2001-08-13 Thread Johannes Janson
hi, [...] My question is this: how can I select only those first 20 words in the PHP code? SELECT LEFT(YourBlobFiekd, 20) FROM YourTable; hope it helps Johannes -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

[PHP-DB] Re: update mysql table using php

2001-08-13 Thread Johannes Janson
Hi, Any ideas as to what the problem is? What error do you get? Is the query not working? Put a mysql_error() into your or die(The category...) to get the exact error message. And try putting quotes around CAtID = '$value'. print a href= . '' . display.php . '' . Return to the print a

[PHP-DB] Re: getting a details-page

2001-09-12 Thread Johannes Janson
Hi, I have a problem: with a mysql_query I get the results of a table field into a list page. Is it possible to use this result (as link) to open a new page where the detailed results of each row are shown? So you select one field and list it with a while-loop? Assuming this you can make a

Re: AW: [PHP-DB] getting mysql_fetch_row into array

2002-09-23 Thread Johannes Janson
Hi, $res = mysql_query (SELECT COUNT(deptid) FROM maintenance GROUP BY deptid); $deptcount = array(); // reset the array while ($row = mysql_fetch_row ($res)) { $deptcount[] = $row[0]; this should be $deptcount[] .= $row[0]; shouldn't it? } cheers J -- PHP Database Mailing List

Re: AW: [PHP-DB] getting mysql_fetch_row into array

2002-09-23 Thread Johannes Janson
Hi, Micah Stevens wrote: Nope. Anytime you set an array with no index equal to something, (i.e. $deptcount[]) it will add another element to the end of the array. If you use .=, that means append the data, but since you're not specifying an element, I'm not sure what it would do. Perhaps