Re: [PHP-DB] Minor Change

2005-12-12 Thread Shahmat Dahlan
did it say which line does the error "Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in" is referring to. if it is referring to the line which contains the function call mysql_query (), dpirago is right, there could be some mistake in the sql statement. r

[Fwd: Re: [PHP-DB] Re: SELECT & html ]

2005-12-04 Thread Shahmat Dahlan
-- Best Regards, Shahmat Dahlan Research and Development SAINS Mobile: +(60)16 882 6130 Office: +(60)82 426 733 ext 5512 --- Begin Message --- (1) i've been using this method for years now, maybe somebody else has a better way to do this? "; php codes $i++; } ?> (2)

Re: [PHP-DB] Detailed Report

2005-10-27 Thread Shahmat Dahlan
Any one can help? I´m a bit stalled thx regards. -- Best Regards, Shahmat Dahlan Research and Development SAINS Mobile: (60)16 882 6130 Office: (60)82 426 733 ext 5512 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Remove MySQL Server

2005-10-21 Thread Shahmat Dahlan
You can also run this, that is if you haven't manually removed your mysql installation directory c:\>mysqld --remove ,where is usually MySQL Unnawut Leepaisalsuwanna wrote: 1. Run Regedit or regedt32. 2. Find the registry entry: |HKEY_LOCAL_MACHINE/SYSTEM/CurrentContro

Re: [PHP-DB] Re: MySQL Connect using Dreamweaver

2005-10-13 Thread Shahmat Dahlan
Correct me if I'm wrong, but if I'm not mistaken Mysql 5 will not work in Dreamweaver. It will only work if you have 4.x (can't remember the exact version) Even if you have installed Mysql 4.x, u must make sure you add in old_password at the last line of the my.cnf If not, you can always updat

[PHP-DB] Re: session

2005-08-16 Thread Shahmat Dahlan
_get_cookie_params (); I don't even get any values as for for lifetime, url and host. Regards and thank again. Shahmat Dahlan wrote: In my php.ini I've enabled session.use_cookies=1 Everytime I initialize a session, it create the session storage file in my /tmp At the top my scr

[PHP-DB] session

2005-08-16 Thread Shahmat Dahlan
In my php.ini I've enabled session.use_cookies=1 Everytime I initialize a session, it create the session storage file in my /tmp At the top my script, I've added session_start (); In my test login function, this was what I did: $_SESSION['username'] = 'abcdef'; session_set_cookie_params (time

Re: [PHP-DB] Current web page being displayed

2005-08-06 Thread Shahmat Dahlan
Or you can do the one show below M Saleh EG wrote: lol... print_r($_SERVER); would be enough to show you all the server array tags. On 8/7/05, *Shahmat Dahlan* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote: You can try foreach ($_SERVER as $key => $value)

Re: [PHP-DB] Current web page being displayed

2005-08-06 Thread Shahmat Dahlan
You can try foreach ($_SERVER as $key => $value) echo "$key => $value"; or you can check out them out in when calling phpinfo (); RaJeSh VeNkAtA wrote: hai .. if u r seeing http://www.google.com/blog/myblog.php then $_SERVER[SERVER_NAME] would give u www.google.com and $_SERVE

Re: [PHP-DB] explode / implode function call on a field with blob type

2005-08-04 Thread Shahmat Dahlan
My apologies, I got it all wrong, I simply went and used the split function and join those strings together, and it works. Shahmat Dahlan wrote: Correction, my corrected code (mistake in the last line, echo $row->data): $sql_stmt = "SELECT id, data FROM announcements"; $query

Re: [PHP-DB] explode / implode function call on a field with blob type

2005-08-04 Thread Shahmat Dahlan
#1 $data_stripped = implode (" ", $tmp); #2 ### echo $row->data; my mistake, it should be this: echo $data_stripped; } Shahmat Dahlan wrote: I have the following table structure called announcements - id int(6) - data longblob And this is what i did: $sql_stmt = &q

[PHP-DB] explode / implode function call on a field with blob type

2005-08-04 Thread Shahmat Dahlan
I have the following table structure called announcements - id int(6) - data longblob And this is what i did: $sql_stmt = "SELECT id, data FROM announcements"; $query = mysql_query ($sql_stmt); while ($row = mysql_fetch_object ($query)) { echo $row->id; $tmp = explode (" ", $row->data, 10);

Re: [PHP-DB] Re: printing errors

2005-08-03 Thread Shahmat Dahlan
both mysql_error () and mysql_errno () are suppose to "assist" you in determining the cause of problems you may encounter with your mysql-related coding. it's not a question of knowing what php can tell you what's wrong, it's what your mysql db is telling you. you should refer to the mysql error

Re: [PHP-DB] Connect remote DB server

2004-10-11 Thread Shahmat Dahlan
for reply! "Shahmat Dahlan" <[EMAIL PROTECTED]> ??? news:[EMAIL PROTECTED] ???... I think the mysql extension was not loaded, that's why you got the message, and it was not able to recognize the function mysql_connect. Fatal error: Call to undefined function: mysql_connect() h

Re: [PHP-DB] Connect remote DB server

2004-10-11 Thread Shahmat Dahlan
I think the mysql extension was not loaded, that's why you got the message, and it was not able to recognize the function mysql_connect. Fatal error: Call to undefined function: mysql_connect() how did you install your copy of php? compile it from source? Laurence Lim wrote: Hi all, im new to PHP

Re: [PHP-DB] Form action

2004-10-10 Thread Shahmat Dahlan
When I first started out with PHP, I asked the same myself the same questions as you just did. But over the years I have concluded: Method (1) centralizes all your form submission processes for addition, deletion, updating purposes, which means when you want to start debugging, you would end up

Re: [PHP-DB] Strange bahavior with mysql_fetch_array($result)

2003-11-20 Thread Shahmat Dahlan
What of the sql statement? If your sql statement had mistakes in it (be it typo, or wrongly constructed statements), it will not even execute the if (!mysql_fetch_array($result)) { } portion of your code. You might want to construct your error checking portion differently as opposed to wha

Re: [PHP-DB] mail function

2003-10-30 Thread Shahmat Dahlan
The textarea tag has an option called wrap, pls read below (extracted from w3c.org) Carriage returns and line feeds entered by the user are ignored and one line of text is sent to the server. No automatic wrapping is done, so the user must scroll horizontally to see lines that extend pas

[PHP-DB] acquiring value from a sql statement which contains an alias

2003-10-20 Thread Shahmat Dahlan
I have a question, I have this SQL statement, $sql_stmt = "SELECT DISTINCT EXTRACT(YEAR_MONTH FROM visitdate) AS availYearMonth FROM visitedurl;"; $result = mysql_query ($sql_stmt); while ($row = mysql_fetch_array ($result, MYSQL_ASSOC)) { echo $row["availYearMonth"]; } By right the value that

Re: [PHP-DB] SoS

2003-10-05 Thread Shahmat Dahlan
urned it on? Do I need to recompile the Php? I also tried "if (isset($_GET["id"])) and found out that $id is NULL. So, there will be an error in the SQL statement. Zhan Xu EECS Department Case Western Reserve University ----- Original Message - From: Shahmat Dahlan <[EMAIL PRO

Re: [PHP-DB] SoS

2003-10-05 Thread Shahmat Dahlan
if the statement "if (isset($id)) doesn't probably it because register_globals has been turned off maybe? How about "if (isset($_GET["id"]))" ? [EMAIL PROTECTED] wrote: Hi, Jason: Thank you very much for your quick reply. I tried the if (isset($id)) but it doesn't work. Any thoughts? By the wa

Re: [PHP-DB] "Consider upgrading MySQL client" .... how do I do this?

2003-09-03 Thread Shahmat Dahlan
one way it to use old_password ()instead of password(), when creating new user name, or update the password for those existing user names with the old_password() function. but then this will force you to use the old password() function, which doesn't really help much... Vinoaj Vijeyakumaar wro

Re: [PHP-DB] mysql date select statement

2003-08-17 Thread Shahmat Dahlan
hav u tried using dashes to denote which portion is the year, month, or day ? e.g. instead of 20030101, you'd probably want to use 2003-01-01. Wendell Frohwein wrote: Hello all, I have this page where I search and add up commissions in a mysql database. I want to select commissions between a cer

[PHP-DB] Javascript+PHP+MySQL

2003-08-16 Thread Shahmat Dahlan
I have a question of Javascript, I don't whether anyone has experience this before, but I think some of you must have. I have the following main form, with a field called location, in which I had used the SELECT html tag and also at the same time, the content for the location field is actually

Re: [PHP-DB] question about '

2003-07-11 Thread Shahmat Dahlan
yes, by adding stripslashes it will somewhat escape those quotes ('), but when displaying the results there will not be any need to do so. unless it is your wish to actually store the backslash into the db. Jerry wrote: I think you should use addslashes to store the text in the database and the

[PHP-DB] A Question on Javascript

2002-11-13 Thread Shahmat Dahlan
I have a question on Javascript, if you don't mind. Say if I have a main page, whereby I would also have a html form which contains a button. Let's call it main document. When I click on the button it will open a new window, which refers to another html page. Now, let's call it child document. No

Re: [PHP-DB] R: [PHP-DB] Javascript

2002-10-11 Thread Shahmat Dahlan
otal = 0; > var thisform = document.forms[0]; > for (i=0;i<=thisform.elements["field[]"].length;i++) { > if (!isNaN(thisform.elements["field[]"].value) total += > thisform.elements["field[]"].value; > } > thisform.totalsum.value=total; &

[PHP-DB] Javascript

2002-10-11 Thread Shahmat Dahlan
My question might have anything to do with PHP but I have the following scenario: Say I have four fields field1 : field2 : field3 : field4 : And a total sum field, which is a total sum of the value of the expression, totalsum = field1 + field

Re: [PHP-DB] Force Refresh on Another Window w/ Javascript

2002-02-27 Thread Shahmat Dahlan
7;s actually JavaScript that you want, and you need > something like this on the body of the HTML page in the window you open > > > > something like that will do it for you, take a look at the javascript > developer's guide (from developer.netscape.com) > > HTH &g

[PHP-DB] Force Refresh on Another Window w/ Javascript

2002-02-27 Thread Shahmat Dahlan
I have a question, let's say i have my main page (so called) called "index.php". I have also displayed a buttonin index.php, which i will used the "onClick" event to trigger a "window.open" function to the same main page, "index.php" (but with parameters). so my index.php should have these cod

[PHP-DB] PHP Build/Compile Problem

2002-01-15 Thread Shahmat Dahlan
I have configured apache according to the readme included in the apache source: ./configure --prefix=/usr/local/apache And then configure php: ./configure --with-apache=../apache_1.3.22 make make install After that configure apache again while activating the php module: ./configure --prefix=/usr

[PHP-DB] Displaying long list in pages

2001-12-07 Thread Shahmat Dahlan
I was trying to list out some records from a MySQL db. And since there my search result returned to many results, I would like to divide them into separate pages. I tried to divide results with maybe 50 to 100 lines per page with the "limit" option into my select statement. I can't somehow figure

[Fwd: [PHP-DB] PHP Binaries for Solaris 8]

2001-11-19 Thread Shahmat Dahlan
In this case, if there aren't any binaries for Solaris 8, how do you compile it under Solaris 8? --- Begin Message --- How can you download PHP binaries for Solaris 8? Can't seem to find it on php.net, and some other sites. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e

Re: [PHP-DB] dlls and inis.Help.

2001-11-16 Thread Shahmat Dahlan
try this extension_dir = enable_dn=on extension=e:\apps\php\extensions\php_interbase.dll fyi, I'm running on Win NT 4, with apache 1.3.20 and php 4.06. regards DL Neil wrote: > > Anyone got a clue for this piece of "bad luck"? > > I'm on win2k pro + IIS5 +php4.0.6 cgi installation. It works

[PHP-DB] PHP Binaries for Solaris 8

2001-11-15 Thread Shahmat Dahlan
How can you download PHP binaries for Solaris 8? Can't seem to find it on php.net, and some other sites. -- 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: [

Re: [PHP-DB] Access counter

2001-07-23 Thread Shahmat Dahlan
open the text file > 2. counter = counter +1 > 3. write update > 3.5 print number of hits somewhere on webpage > 4. close file... > > Shahmat Dahlan wrote: > > > > I'd like to do a counter with PHP, how do you do this? I thought maybe I > > could either us

[PHP-DB] Access counter

2001-07-23 Thread Shahmat Dahlan
I'd like to do a counter with PHP, how do you do this? I thought maybe I could either use cookie or session or session? Which should I use ? regards and thanks is adnved -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail

Re: [PHP-DB] Query in a function

2001-06-26 Thread Shahmat Dahlan
How about declaring some of the variables as global variables. regards seriousj wrote: > Hello > I have a query that I have placed in a function that is in a file that I > "include" in the page to be displayed. It doesn't work. I know that the code > works because when I place the code in the

Re: [PHP-DB] Merge two arrays into associative arrays?

2001-05-21 Thread Shahmat Dahlan
t;,"b","c","d","e"); > $c = array(); > > $arraysize = sizeof($a); > for ($i=0;$i<$arraysize;$i++) { > $c[$a[$i]] = $b[$i]; > } > ?> > > / Lars > www.ljweb.com > > - Original Message - > From: "Jonat

[PHP-DB] Merge two arrays into associative arrays?

2001-05-21 Thread Shahmat Dahlan
Is there anywhere possible for me to merge two arrays into associative arrays? e.g. $a=array(1,2,3,4,5); $b=array("a","b","c","d","e") into $c=array(1 => "a", 2 => "b", etc... ) Thanks in advance.. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED]

Re: [PHP-DB] display variable variables in a text field in a form

2001-05-18 Thread Shahmat Dahlan
"; > > sometimes i can get away without splitting the string but generally i find > it easier to do it this way ... > > p.s. if there are any rules i'm not aware of as to the format of strings > including values from db's i'd be really grateful if someone could p

Re: [PHP-DB] MySQL Connect Problem

2001-05-18 Thread Shahmat Dahlan
If this is the case, you need to check the rights that your id "jeff" has. It should be in the mysql database under the tablename user. You have to make sure that you have all the rights, all the priviliges equals to 'Y'. I'm not really sure how these previiliges, but you can just set everything

[PHP-DB] display variable variables in a text field in a form

2001-05-18 Thread Shahmat Dahlan
$fields=array("fname","lname","dept","city","ophone","hphone","fax","email"); $sqlstmt="SELECT * FROM contacts WHERE id='$id'"; $result=mysql_query($sqlstmt); foreach ($fields as $values) { print "\n$fieldn\n\n \n"; } I'm not sure how to explain this, when do the above (I have omm

Re: [PHP-DB] MySQL Connect Problem

2001-05-15 Thread Shahmat Dahlan
Is the MySQL and Apache running on the same machine? Jeff Oien wrote: > I have MySQL on a new Win2000 install and can't connect to it using PHP. > I am able to connect using the command line. I'm not sure what the next > step is to troubleshoot. I've checked the username and password in the > .i

Re: [PHP-DB] Error Msg: Wrong data type when performing "extract()"

2001-04-18 Thread Shahmat Dahlan
You're right, no row was returned by the query when i did tried to fetch it. So I suppose the next viable thing to do is to figure what went wrong with the query. Thanks CC Zona wrote: > In article <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] ("Shahmat Dahlan") wrote

[PHP-DB] Error Msg: Wrong data type when performing "extract()"

2001-04-18 Thread Shahmat Dahlan
$sqlstmt ="SELECT stock_in.id, equip.equip_type, "; $sqlstmt.="equip.brand, equip.model, "; $sqlstmt.="vendor.name, stock_in.po_no, "; $sqlstmt.="stock_in.vendor_sales_no, stock_in.cust_po_no, "; $sqlstmt.="stock_in.serial, stock_in.warranty, stock_in.date_received, "; $sqlstmt.="stock_in.remark,

Re: [PHP-DB] Updating multiple forms

2001-04-18 Thread Shahmat Dahlan
e: > > > > > Hi, > > > > > > What do you mean by updating data into multiple forms? Do you mean > > > displaying data in multiple HTML forms? > > > > > > Lester > > > > > > At 04:53 PM 4/18/01 +0800, Shahmat Dahlan wrote: > >

Re: [PHP-DB] Updating multiple forms

2001-04-18 Thread Shahmat Dahlan
t 04:53 PM 4/18/01 +0800, Shahmat Dahlan wrote: > >How do I update data into multiple forms? > > > >Thanks in advance.. > >Shahmat -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To

[Fwd: [PHP-DB] Updating multiple forms]

2001-04-18 Thread Shahmat Dahlan
Apologies... Lemme rephrase my question, How do I update data into multiple tables in MySQL (with PHP, of course)? Thanks in advance.. Shahmat How do I update data into multiple forms? Thanks in advance.. Shahmat -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [

[PHP-DB] Updating multiple forms

2001-04-18 Thread Shahmat Dahlan
How do I update data into multiple forms? Thanks in advance.. Shahmat

Re: [PHP-DB] php with mysql - multiple tables

2001-04-15 Thread Shahmat Dahlan
printf("%s ", $myrow["equip_type"]); //no table name did not work, and did not display the content But if I apply the extract on $myrow, it worked.. extract($myrow); printf("%s ", $equip_type); Thanks regards CC Zona wrote: > In article <[EMAIL PROTECT

[PHP-DB] php with mysql - multiple tables

2001-04-15 Thread Shahmat Dahlan
I have three tables, whereby I have used a select statement to extract some of the fields from each and one of the tables. e.g. $sqlstmt ="SELECT stock_in.id, equip.equip_type, equip.brand, equip.model, vendor.name "; $sqlstmt.="FROM stock_in,equip,vendor "; $sqlstmt.="WHERE equip.id=equip_id and

[PHP-DB] PHP Include

2001-03-21 Thread Shahmat Dahlan
If I were to break my codes into pieces and put them into seperate files and call them from a single "depository" php script, how do I pass variables from one file to another? Thanks in advance. Shahmat -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED

[PHP-DB] Loading extensions

2001-03-20 Thread Shahmat Dahlan
I have IIS 4 with PHP 4pl1 running on Win NT 4. I can't seem to load the (*.dll) extensions. There seem to be something wrong with the extension path. The browsercap.ini path is pointing to the right path. Can anyone help? Thanks in advance. Shahmat -- PHP Database Mailing List (http://www.php

Re: [PHP-DB] mysql_result

2001-03-20 Thread Shahmat Dahlan
That didn't quite work, I tried using single quote enclose within double quotes and it works. $sqlstmt="SELECT * FROM dept WHERE shortname='$shortname'"; Thanks anyway ben wrote: > On Tue, 20 Mar 2001, Shahmat Dahlan wrote: > > > I'm trying to

Re: [PHP-DB] mysql_result

2001-03-20 Thread Shahmat Dahlan
I've tried what you suggested and it works, thanks. Russ Michell wrote: > Try: > > $sqlstmt="SELECT * FROM dept WHERE shortname='$shortname'"; > //Include single quotes.. > > Russ > > #---# > > "Believe nothing - consider everything"

[PHP-DB] mysql_result

2001-03-20 Thread Shahmat Dahlan
I'm trying to use mysql_result to extract data from one particular field in a record. So I suppose the most viable solution is to use mysql_result. But when I do this: $sqlstmt="SELECT * FROM dept WHERE shortname=$shortname"; $result=mysql_query($sqlstmt); $temp=mysql_result($result,0,"shortname"