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);
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"
Russ
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 use mysql_result to extract data from one
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
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
PROTECTED],
[EMAIL PROTECTED] ("Shahmat Dahlan") wrote:
$result=mysql_query($sqlstmt);
I know the $sqlstmt query does work. But if I do a mysql_fetch_array and
assign it to a variable called $myrow,
while ($myrow=mysql_fetch_array($result)) {
...
}
how do I dis
How do I update data into multiple forms?
Thanks in advance..
Shahmat
Apologies...
Lemme rephrase my question,
How do I update data into multiple tables in MySQL?
Shahmat
Lester June Cabrera wrote:
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
?
Lester
At 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 contact
$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,
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:
$result=mysql_quer
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
.ini
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
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]
For additional
www.ljweb.com
- Original Message -
From: Jonathan Hilgeman [EMAIL PROTECTED]
To: 'Shahmat Dahlan' [EMAIL PROTECTED]
Cc: PHP-DB (E-mail) [EMAIL PROTECTED]
Sent: Monday, May 21, 2001 6:10 PM
Subject: RE: [PHP-DB] Merge two arrays into associative arrays?
try:
$a=array(1,2,3,4,5);
$b
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 page
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,
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 use cookie or session or session? Which should I use ?
regards and thanks is adnved
--
PHP
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:
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 fine
In this case, if there aren't any binaries for Solaris 8, how do you
compile it under Solaris 8?
---BeginMessage---
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,
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
I have a question, let's say i have my main page (so called) called
indexphp
I have also displayed a buttonin indexphp, which i will used the
onClick event to trigger a windowopen function to the same main
page, indexphp (but with parameters)
input type=button value=Add New Records
-
// From: Shahmat Dahlan [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 28 February 2002 2:36 PM
// To: PHP-DB
// Subject: [PHP-DB] Force Refresh on Another Window w/ Javascript
// Importance: High
//
//
// I have a question, let's say i have my main page (so called) called
// index.php
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 +
) total +=
thisform.elements[field[]].value;
}
thisform.totalsum.value=total;
}
-Messaggio originale-
Da: Shahmat Dahlan [mailto:[EMAIL PROTECTED]]
Inviato: venerdi 11 ottobre 2002 11.35
A: [EMAIL PROTECTED]
Oggetto: [PHP-DB] Javascript
My question might have anything to do
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.
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
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
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
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
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 way,
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 PROTECTED]
Date: Monday, October 6, 2003 6:07 am
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 I
The textarea tag has an option called wrap, pls read below (extracted from w3c.org)
TEXTAREA NAME=foo ROWS=4 COLS=40 WRAP=OFF
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
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
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
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
!
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()
how did you install your copy of php
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
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); #1
); #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 = SELECT id, data FROM announcements;
$query = mysql_query ($sql_stmt
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 = mysql_query
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
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)
echo $key
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
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 script, I've added session_start ();
In my test login function
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
You can also run this, that is if you haven't manually removed your
mysql installation directory
c:\mysqld --remove service name
,where service name is usually MySQL
Unnawut Leepaisalsuwanna wrote:
1.
Run Regedit or regedt32.
2.
Find the registry entry:
| A36 | London
Providers | Mark | B67 | Madrid
And I need the report in the following format:
Customers
John - A36 - New York
Jason - B45 - Los Angeles
Max - A36 - Paris
Providers
John - A36 - London
Mark - B67 - Madrid
Any one can help? I´m a bit stalled
thx
regards.
--
Best Regards,
Shahmat
--
Best Regards,
Shahmat Dahlan
Research and Development
SAINS
Mobile: +(60)16 882 6130
Office: +(60)82 426 733 ext 5512
---BeginMessage---
(1)
i've been using this method for years now, maybe somebody else has a
better way to do this?
?
sql query
$i = 0;
while (sql result fetches
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.
52 matches
Mail list logo