Hi,
You could try to change date("m") to date("n"), and date("d") to date("j").
It looks that sometimes mktime() doesn't remove the trailing zeroes and
returns totally different dates.
The other thing you could try is
$date = date("F dS, Y g:i:s A", date("U")+18000);
this one takes the number se
Hi,
All MySQL version higher than 3.22 support the following syntaxis
DROP TABLE IF EXISTS tbl_name
HTH
Dobromir Velev
-Original Message-
From: MrBaseball34 <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Tuesday, November 27, 2001 18:37
Subject: [PHP-DB] ?? If Table
I am using this to read the uploaded file
$attach_data =
addslashes(fread(fopen($HTTP_POST_FILES['attachment']['tmp_name'], "r"),
filesize($HTTP_POST_FILES['attachment']['tmp_name'])));
I'm then insterting that into the MySQL database, along with the
$attachment_type
It works fine for a GIF, bu
Try
header('Content-type: image/gif');
Regards,
Andrey Hristov
IcyGEN Corporation
http://www.icygen.com
BALANCED SOLUTIONS
- Original Message -
From: "PaulC" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, November 28, 2001 10:28 AM
Subject: Re: [PHP-DB] Storing JPEG's in
excuses,
image/jpeg
- Original Message -
From: "PaulC" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, November 28, 2001 10:28 AM
Subject: Re: [PHP-DB] Storing JPEG's in MySQL -- Is it possible?
> I am using this to read the uploaded file
>
> $attach_data =
> addslashes(fr
I have read the parts of the manual(s) but am just not grasping something...
I have 2 tables, one holds the Property ID etc., and the other holds all the
Property Details. They are connected by a field called 'PropertyID' which is
a unique ID that appears in both records.
I want to count the num
Hello,
I have some problems to put Null value in a field of a data base in Access.
This field is numeric type. When I submit the form, variable has $var='', I
set it $var=Null, but ODBC returns an error:
Warning: SQL error: [Microsoft][Controlador ODBC Microsoft Access] No
coinciden los
select * from tbl where email like "%$email%"; This will find the string stored in the
variable
'$email' in the column 'email'
Adjust having the '%' at the end, the beginning or both (as above) as they will find
the string
'$email' at end or at the beginning of the string stored in the column
$sql = '..'.($var? $var:'NULL').'.;';
Regards,
Andrey
- Original Message -
From: "Silvia Mahiques" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, November 28, 2001 11:37 AM
Subject: [PHP-DB] set NULL vaules in Access DB
>
> Hello,
> I have some problems to put Null
No this will not do what the original poster requested
it will be something like the following
select * from table where email regexp
"^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,3}$";
Regards
Jon
--
Jon Farmer
Systems Programmer, Entanet www.enta.net
Tel 01952 428969 Mob 077
Glad someone knows more than I do, or that chap would be right up a certain creek
without a paddle..
Cheers
Russ
On Wed, 28 Nov 2001 09:44:26 - Jon Farmer <[EMAIL PROTECTED]> wrote:
> No this will not do what the original poster requested
>
> it will be something like the following
>
>
The following does work but it extremely slow.
$phselect = "select COUNT(*) AS phTotal from properties LEFT JOIN
propertydetails ON properties.PropertyID=propertydetails.PropertyID where
((propertydetails.Image1Desc='') AND
(properties.PropertyType='$PropertyType'))";
$phresult = mysql_q
I would suggest changing COUNT(*) to COUNT(properties.PropertyID)
Regards
Jon
--
Jon Farmer
Systems Programmer, Entanet www.enta.net
Tel 01952 428969 Mob 07763 620378
PGP Key available, send email with subject: Send PGP Key
- Original Message -
From: "Martin E. Koss" <[EMAIL PROTECTE
You use LEFT JOIN so your query is optimized. Probably your tables are big, you don't
have many MB of RAM. When you have big RAM, I
think that tables reside in memory and join of 5 tables every >600,000 rows is done
for 4-5s. May be you have to increase some of
the buffers sizes of mysql.
Regar
I'm working on an application that selects a user's userid if their password
and login match. If the login and password match I want my variable $cir to
run its own select statement and return its corresponding contactid...for
this example we'll say that value = 5. I then want to plug in $cir in
Try,
$query="select * from my_contacts where contactid like '$cir'";
Kevin Ruiz wrote:
>
> I'm working on an application that selects a user's userid if their password
> and login match. If the login and password match I want my variable $cir to
> run its own select statement and return its
Very interesting. I didn't know you could use SET with an INSERT. I tried this on MySQL
and it worked. Dunno if it's standard SQL, but it didn't work on MSAccess and MS
SQLServer
(the only other DBs I have at hand to test it with). I wonder what other DBs it works
on,
because you could be painti
Hi there everyone:
I have a generic query containing variables, substituted for values dependant upon
specific
circumstances:
//query the DB on the basis of searches employing text input fields (LIKE)
if($sql_clause == 'LIKE') {
$sql = "SELECT * FROM $table WHERE $field $sql_clause '%$quer
echo "\r\n";
while($row = mysql_fetch_assoc($result)) { // if assoc is not available - will work
but double results
foreach($row as $key => $value){
echo "$key$value\r\n";
}
}//end loop
echo "\r\n";
HTH
Regards,
Andrey Hristov
IcyGEN Corporation
http://www.icygen.com
BALANC
Actually, there is another way of doing it. The prerequisite for this
method, is that you have an auto_incremented column. If you have that, then
all you have to do is insert a value into one of the columns, then grab
mysql_insert_id, and update all columns, corresponding to that
auto_incremente
Try using mysql_query to describe the table in question (describe $table), and use the
output
as a list of field names (and types). I wrote a generic script to do this for an
app... can
provide if needed (although it sure looks a little hacked right now, hmmm)
-db
Russ Michell wrote:
> Hi
--
--
Dan Barton
Terrestrial Program Biologist
Asst. Data Manager
Point Reyes Bird Observatory
http://www.prbo.org
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--- Begin Message ---
Try:
select sum(if(whatever=whatever,1,0)) as whatever from wherever where
whatever=whatever;
This is a pretty
Nice one folks!
Thanks for your help - it's amazing what happens to one's brain once you start to
think about the
problem in hand enough (enough that is, to attmept to make it make sense to others!..)
- I sussed
the problem, using a similar method described to me my several of you. (and a lit
Hello, wonder if anyone can debug this script.
I copied it from an example in a book.
There is a .php file and a .inc file
This is the .inc file:
the .php file is like this:
";
}
?>
Sorry about poxy formatting, hope it is legible.
I seem to have a problem passing the database to the db
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hello B.,
This happens with either 4.0.4 or 4.0.6.
What did you do to solve it?
JBB
Tuesday, November 27, 2001, 2:37:17 PM, you wrote:
BP> le ven 23-11-2001 à 02:18, Jonathan B. Bayer a écrit :
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA1
I've come across yet another problem.
I have a table set up that houses four things, a person's real name,
username, pass, and id. The id is used to join another table which houses
that persons contacts. I've been validating the user and pass by comparing
the number of rows that the sql stateme
On Thursday 29 November 2001 01:29, Kevin Ruiz wrote:
> I've come across yet another problem.
[snip]
> $ci = "select contactid from users where username='$username' and
> password='$password'";
> $cir = mysql_query($ci)
> or die("Couldn't execute");
> $query
$query="select * from my_contacts where contactid like \"$cir\"";
Fred
Kevin Ruiz <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I'm working on an application that selects a user's userid if their
password
> and login match. If the login and password match I
Sorry, that was a bit hasty.
I was just trying to get the method across quickly.
SELECT SUM(IF(Image1Desc!='insert default value of Image1Desc here'),1,0) as
phTotal from PropertyDetails;
would count the number of entries where Image1Desc!=default in PropertyDetails.
This can be used in combin
Hi,
I'm just getting started with php/mysql and I have a big question: how do I
handle the special chars? when I import an excel sheet into my db, all
special chars are displayed wrongly. If a change them to html entities befor
the import, it works, but it's ugly to have all the & and whatnot in
Interesting.
A bit tiedious, I suppose. Seems like it'd be a bit more overhead than I'd care to
have,
but an interesting technique nonetheless.
TIM
-I date this girl for two years and then the nagging starts: "I
wanna know your name." - Mike Binder
> -Original Message-
> From: Ubaidul
well, I didn't debug this massive script, but
maybe you just want to connect to a mysql database?
then this is the short way:
$user = "your_username_for_the_database";
$pass = "your_password_for_the_database";
$con = mysql_connect("your_host", $user, $pass);
if(!$con) {
print "no connection
Hello
I would like to create some PHP scripts which do not rely on a specific
DB. As first DB I use PostgreSQL so I have included the line:
include_once("DB/pgsql.php");
in my script but I get the following error:
Fatal error: Class db_common: Cannot inherit from undefined class pear
in /usr/
Or what about:
common_db.inc with just the following:
(which you would for security reasons put in a directory outside the
webroot, and rename the file to .common_db.inc (with a . in front of it))
show_more_db.php with
Couldn't connect to specified server");
mysql_select_db($default_dbname)
which is even better, all I tried to do was to point out just how simple it
can be...
btw. I prefer mysql_fetch_array
ps.
(ik woon in koudekerk, kilometertje of 8 van waddinxveen en werk als
tekenaar op een ingenieursburo... klein wereldje)
Leo Kuiper
"Building a map in order to find what's not
Can the SUM keyword in SELECT be generalized to strings?
A tipical use for the SUM keyword is:
SELECT column1, SUM(column2)
FROM table
GROUP BY column1
This works only if column2 contains numbers (and SUM is the mathematical
sum).
What about obtain the same behaviour, when column2
I am reading a book that refers to changing the value of an option in my
php.ini file. I am using a virual server running FreeBSD which already has
PHP4 installed and I assume they opted not to install it using the php.ini
option, hence it does not exist. It is installed as an Apache module,
the
PHP as an apache module requires the php.ini file. Look harder and you will
find it somewhere.
session.save_path is the file on the server where sessions are stored. It
has nothing to do with the client machine.
Fred
Jonathan Duncan <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news
So in otherwords, the session.save_path doesn't refer to where it will save
information on the end users computer, it only refers to where it will save
information on my server. That makes much more sense, and yes I agree,
Windows as a server? Hehe.
Thank you very much,
Jonathan Duncan
-
Hello,
"Tomas V.V.Cox" wrote:
>
> Manuel Lemos wrote:
> >
> > > >
> > > > But it does not work with computed columns like those that apply
> > > > functions (COUNT, SUM, SUBSTRING, etc...). The code assumes that you are
> > > > actually selecting only real table fields. I think it also does not
Dear group,
First off let me say, "Bare with me." I am a total PHP newbie.. I have
managed to build a web site that includes a database.. I am using Apache
1.3.somthing(whatever the current stable is) with MySQL on winXP. The thing
that I am having trouble with is when I try to list data, I
if I have the following in 10 seperate pages:
OCIPLogon($User,$Pass,$DB_name);
Do I have 10 seperate database connections, one for each page or do I
have so other number of connections?
Thanks.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For ad
Hi,
Check out the following for OCI libs for FreeBSD.
# There are native FreeBSD libraries (OCI). You can get them, for example,
# from ftp://iclub.nsu.ru/pub/FreeBSD/incoming/OCI.freebsd.elf.tar.gz
You install the libs, compile php with oracle while pointing to the installed
libs and it shoul
On Mié 28 Nov 2001 19:42, you wrote:
> Can the SUM keyword in SELECT be generalized to strings?
>
> A tipical use for the SUM keyword is:
>
> SELECT column1, SUM(column2)
> FROM table
> GROUP BY column1
>
> This works only if column2 contains numbers (and SUM is the mathematical
> sum)
Use $AUTH_USER for the username, and you shouldn't need to pass the
password. Just do a query:
INSERT INTO tablename (field1,field2,field3) values('','','') where username
= $AUTH_USER
Ryan Marrs
Web Developer
Sandler and Travis Trade Advisor
Dear all
I had a security problem with my homepage. I'm using the IIS 4 to host my
webpage, and i got the php to run as the script of the webpage and the
database i'm using for the database is mysql.
Here is my question :
There is a table in mysql which will let user to input some records to, the
46 matches
Mail list logo