Maybe it is not null but has empty content?
the first statement is correct
try
>> SELECT * FROM questions WHERE (answer IS NOT NULL OR answer<>'');
or maybe
>> SELECT * FROM questions WHERE LENGTH(answer)>0;
- Original Message -
From: "Pambos Nicolaou" <[EMAIL PROTECTED]>
To: <[EMA
Hi everyone
I am a new user of this mail list and I hope that it will be helpful.
I am trying to show the content of a MySQL table(raw) where the content of a
column is NOT NULL. I used the commands below but the result shows the
content of the whole table for the first case and nothing in the
Use UPDATE statement
UPDATE tbl SET date_field=NOW() where index=your_index
or
UPDATE tbl SET date_field='2004-04-22' where index=your_index
- Original Message -
From: "charalambos nicolaou" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, April 22, 2004 3:35 AM
Subject: [P
Hi everyone,
How can I insert a value in to a field of a MySQL table which is already
NULL but the others in the same row are not.
Also I would like to know if there is a way of inserting in to a DATE filed
the date of the browser.
Thanks in advance.
Charalambos
___
> Hi.
>
> Any body got an idea how to use hte foreign keys in mysql innodb tables
> and how whould the change affect the performance of the server?
>
> lets say i have Items table, Clients table, and Sales table
> the Sales table always stores ClientID and ItemID
> but not every client/item is ther
"Uzi Klein" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi.
>
> Any body got an idea how to use hte foreign keys in mysql innodb tables
> and how whould the change affect the performance of the server?
>
> lets say i have Items table, Clients table, and Sales table
> the Sales tab
Hi.
Any body got an idea how to use hte foreign keys in mysql innodb tables
and how whould the change affect the performance of the server?
lets say i have Items table, Clients table, and Sales table
the Sales table always stores ClientID and ItemID
but not every client/item is there
a sale can b
"Uzi Klein" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Does anybody know of a good tutorial of using foreign keys in MySQL InnoDB
> tables?
Take a look here:
http://dev.mysql.com/doc/mysql/en/InnoDB_foreign_key_constraints.html
Should contain everything you need to know about
Still doesn't work the way I want it. My boss is taking a look at it, she
knows SQL really well, I was trying to do this without her assistance, but
its just harder then I was expecting. thanks for the help tho
On Wed, 21 Apr 2004, Daniel Clark wrote:
> How about
>
> SELECT distinct badge.id
How about
SELECT distinct badge.id, convert( varchar,eventime,110) as date
Shows all the badge numbers IN on that date. If the badge number is not
there, they didn't check in at ALL that day.
> This seems too easy to not be able to do it with SQL. There must be
> something we're missing in th
Re-read my original email, I'm using mssql and not mysql. I'm sort
of close to having it working with the sql statement i posted earlier and
using PHP to figure out if the date has changed or not and to count the
cardnum if the date hasn't changed. I'm getting a number that is
different then
This seems too easy to not be able to do it with SQL. There must be
something we're missing in the query.
Try this:
select distinct badge.id,convert( varchar,eventime,110) as date,count(*)
from events, badge where
events.cardnum = badge.id and devid = '1' and
convert( varchar, events.eventime, 11
Lambert, Patrick wrote:
So it sounds like you need to examine the headers of the response (which
sounds like it is a redirect)?
Try PEAR's HTTP_Request (http://pear.php.net/package/HTTP_Request).
This time in PHP using the above:
Array
(
[response_code] => 302
[response] => HTTP/1.1 302 Fo
Lambert, Patrick wrote:
So it sounds like you need to examine the headers of the response (which
sounds like it is a redirect)?
Try PEAR's HTTP_Request (http://pear.php.net/package/HTTP_Request).
More specifically, you need a HEAD request:
http://pear.php.net/manual/en/package.http.http.head.php
Fo
From: andy amol
>I am using the following code, but it is not populating my script. If
you can help I would be grateful.
> I am using mysql as database.
> $sql = "SELECT course_id FROM course";
> $sql_result = mysql_query($sql)
> or die("Couldn't execute query.");
> while ($row = mysql_fetc
Yeah I basically had that with my previous SQL statement, I was grouping
by event.cardnum instead of counting the cardnums by date. I think what
I'm trying to do is beyond the scope of SQL and I'll have to write some
PHP to take the SQL statement results and feed them into an array and
count t
Or even better :
Try this :
$string = "Hello World";
$TableName = "Table";
$FieldName = "Field";
$Field = "CONCAT_WS('', ' ', TRIM($TableName.$FieldName), ' ')";
$Op = $Type=="All" ? "AND" : "OR";
$where = "WHERE ($Field LIKE '% ".(preg_replace("/[\s]+/", " %' $Op $Field
LIKE '% ", $string))
So it sounds like you need to examine the headers of the response (which
sounds like it is a redirect)?
Try PEAR's HTTP_Request (http://pear.php.net/package/HTTP_Request).
p.
> --
> From: Chris Payne
> Sent: Wednesday, April 21, 2004 12:52 PM
> To: [EMAIL PROTECTED]
> Su
Yes eventtime is a timestamp field (whatever mssql's version of mysql's
NOW() is) and the convert( varchar,eventime,110) converts the timestamp to
a date MM-DD-.
my problem is that with the count, it counts each card swipe, and i only
need to count one card swipe from each patron per day.
AND: any count >=1 shows they came in that day.
How about:
SELECT convert( varchar,eventime,110) as date from events, badge,
count(convert( varchar,eventime, 110)) as count
WHERE events.cardnum = badge.id and devid = '1' and
convert( varchar, events.eventime, 110) BETWEEN '$startdate' and '
How about:
SELECT convert( varchar,eventime,110) as date from events, badge,
count(convert( varchar,eventime, 110)) as count
WHERE events.cardnum = badge.id and devid = '1' and
convert( varchar, events.eventime, 110) BETWEEN '$startdate' and 'enddate'
AND type = '1'
GROUP BY convert( varchar
Try this :
$string = "Hello World";
$TableName = "Table";
$FieldName = "Field";
$Field = "CONCAT_WS('', ' ', TRIM($TableName.$FieldName), ' ')";
$Op = $Type=="All" ? "AND" : "OR";
$where = "WHERE ($Field LIKE '% ".(preg_replace("/[\s]+/", " %' $Op $Field
LIKE '% ", $string))." %')";
$sql = "SEL
I think your problem is that you are using time, when you are not
interested in time, just the date. I'm assuming your eventime column is
a timestamp field. Your goal is to select the badge id and the date,
distinct will then eliminate multiple visits and then you can group by
date to get the v
Chris Payne wrote:
Hi there everyone,
I have a problem. Basically this is what I need to do:
Request behind the scenes (PHP) an ASP Url on a different website with the
value pid=1 (Where 1 is an identifying number). Then I need PHP to
listen to the response from that request as A
Hi there,
>Just to help clarify, is this what you're saying?
If you were to go to the page via a web browser, and put in something
like:
http://www.someserver.com/somepage.asp?pid=11101
it would get changed (in the browser address bar) to something like
http://www.someserver.com/somepath/someo
I'm using some proprietary software/hardware where when a visitor swipes
their entry card, it is recorded in a mssql 2000 server. My boss wants a
count of unique vistors for a range of dates. So, I need to have it give
a count of unique vistors, meaning that I need to count all vists for a
da
--- Chris Payne <[EMAIL PROTECTED]> wrote:
> Hi there,
>
> Thanks for the below, but I'll try to explain it a bit better.
>
> I don't have access to the ASP server, it's a general server setup
> for
> companies, to query their server you must use the
> ?pid=uniquecompanynumber
> as it tracks you
Can also open it in read only:
$fp = fopen ("/home/rasmus/file.txt", "r");
> Hi there,
>
> Thanks for the below, but I'll try to explain it a bit better.
>
> I don't have access to the ASP server, it's a general server setup for
> companies, to query their server you must use the ?pid=uniquecompa
Hi there,
Thanks for the below, but I'll try to explain it a bit better.
I don't have access to the ASP server, it's a general server setup for
companies, to query their server you must use the ?pid=uniquecompanynumber
as it tracks your IP to make sure the correct server is connecting. Anyway,
w
Anyway first you have to translate your problem to us.
In plain english.
But I have spare time, so.. here is the solution for your problem, as I understood it.
from php
http://myserver.com/index.asp?pid=";);
print_r($f);
?>
In ASP you take the pid do what you want to it and then
<%
Resp
Hi there everyone,
I have a problem. Basically this is what I need to do:
Request behind the scenes (PHP) an ASP Url on a different website with the
value pid=1 (Where 1 is an identifying number). Then I need PHP to
listen to the response from that request as ASP will then return
Hi!
But you can replace all information about user on for ex. 'User
real name'=>'Deleted'
Wednesday, April 21, 2004, 6:34:36 PM, -{ wrote:
RB> The problem with this is legal issues. According to Danish law, you're not
RB> permitted to save a person's details for more than a certain amount of ti
Martin E. Koss wrote:
I have a product database which can be searched for a keyword in up to 3
fields; using this select query:
$sql_select = "SELECT * from productlist WHERE (Name LIKE
'%$SearchText%') OR (Description LIKE '%$SearchText%') OR (Keywords LIKE
'%$SearchText%') ORDER BY Name";
What I
Split your phrase with split or explode functions.
Then implode the new array as something like 'i', 'want', 'to', 'search' from 'i want
to search'.
Then create your whereClause for each of the result. If you want to find exactly the
words than you might use the IN keyword.. like SELECT * FROM ta
Hi all you experts who have help me often in the past, may I now ask
what is probably so simple for someone doing PHP everyday...
I have a product database which can be searched for a keyword in up to 3
fields; using this select query:
$sql_select = "SELECT * from productlist WHERE (Name LIKE
'
Was thinking of just dumping users to an "inactive" state as well upon
deleting... it would solve my problem with the join issue for sure ... would
also create alot of database clutter for sure ... Unused user accounts and
such ... I don't like having data in the database that serves no real
purpos
-{ Rene Brehmer }- wrote:
Working with PHP 4.3.0 and MySQL 4.0.14 (but code MUST be compatible with
3.23.56).
For my forums, I've got this 4-way join to load (and output) the posts with
info on the poster:
$fullthread = "SELECT
postID,hf_posts.userID,name,time,post,edit,nickname,joined,location,pos
Hi!
I think it'd be good to add in hf_users column status - ENUM('Active',
'Blocked', 'Deleted'), and when user
will be deleted you should set this status to Deleted. Value 'Blocked'
may give you a simple way to ban user :)
Yes, this method of deletion take more database space, but it'd be
better,
Working with PHP 4.3.0 and MySQL 4.0.14 (but code MUST be compatible with
3.23.56).
For my forums, I've got this 4-way join to load (and output) the posts with
info on the poster:
$fullthread = "SELECT
postID,hf_posts.userID,name,time,post,edit,nickname,joined,location,posts,levelname
39 matches
Mail list logo