On Wednesday 31 July 2002 20:56, Dib, Walid (MED, Stagiaire GEMS) wrote:
How can i print the fiscal week number on a web page??
1) Work out an algorithm to calculate the fiscal week
2) Implement algorithm in php
--
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software
Look at the date functions at:
http://www.mysql.com/doc/D/a/Date_and_time_functions.html
and search for the date_format table
Within it you will see the following:
%U Week (00..53), where Sunday is the first day of the week
%u Week (00..53), where Monday is the first day of the week
%V
Are there any benefits to assigning a query to a variable?
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
How can I add a space to the end of a varchar string
in mysql? I can't seem to do it directly, and I tried
str_pad and other things, but no luck so far. The db
doesnt hold the value of the space...its getting
trimmed somewhere(?)
The reason I want to do this is so I can search for
exact
I haven't set up any text-based searches before, but when you say:
snip
If the user types 'Wash' I don't want any matches for
'Washington', 'Washing', etc.
snip
Aren't you, in essence, saying that you want to search for Wash? Meaning
that your query could just say WHERE name = '$var' (where $var
Richard,
You are correct. For Ron to achieve his goal, the SQL needs to be changed
to:
WHERE name = '$var'
If you use the LIKE operator and have a trailing %, that is telling mySQL to
match the first characters exactly and then match ANY trailing characters.
If you use the equals
Ron
I do believe that placing a space in '%$var %' will do the same as a
varchar and sprip it off the end. Not positive. However I believe
something like this will do the trick:
SELECT something
FROM a_file
WHERE replace(CONCAT_WS('','.',a_file.field,'.'),' ','.') LIKE '%.$var.%'
HTH... Dan
sure there are, you can call the query in multiple places, for example:
$sql = mysql_query(INSERT INTO $table_name WHERE db_field =
$search_string);
Then say you have a routine to check for missing for elements and you would
like to log failed vs. successfull attempts your code flow would be
Yes, I see a few benefits.
1. It makes the code easier to read.
2. It makes the code easier to debug.
Imagine the following:
$sql = SELECT * FROM tblName;
$result = mysql_query($sql);
Now if you want to print the sql and not do the select, you would simply add a line
$sql = SELECT * FROM
thanks, helpers, but I think I have a simple solution:
I will insert a space at the front of the string,
where the db must accept and retain it.
BTW, here is the SQL I am working with:
//
elseif ($desc==desc) {
$sql=SELECT bandid, bandname, bandesc,
Ron Wallace wrote:
thanks, helpers, but I think I have a simple solution:
I will insert a space at the front of the string,
where the db must accept and retain it.
BTW, here is the SQL I am working with:
//
elseif ($desc==desc) {
$sql=SELECT
Hi..
I need to get 2 groups of random result with 1 group always on top of the
other.
Can anyone help me with this please..
Something like
id|group|name
21john
51smith
32 1sara
12 1michael
Me personally, so I can echo out the variable to see if the query is
making sense. Look at it as a debugging...
Brian Graham wrote:
Are there any benefits to assigning a query to a variable?
--
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/
--
PHP Database
[snip]
First of all, sorry for the additional cross post. MeetUp.com lacks the
ability to let you contact other folks who have signed up. In my general
area, Massachusetts, there are a bunch of tiny groups scattered about,
and I'd like a chance to get all of them to converge in one place to make
Hello,
On 07/25/2002 04:35 PM, Andrew Hill wrote:
Manual,
Certainly - please help us pinpoint any issues.
Dan Kalowsky has done some great work in resolving lingering ODBC issues
in PHP, and I help in my way with testing and iODBC support.
I respect the work you have done with
did you mean you need help with an sql query for this?
sounds like
select id, group, name from MYTABLE order by group;
since i cant read your mind and you didnt specify anything else and since
this is a php-db mailing list, hope that's what you are asking for... of
course i could me a mile
16 matches
Mail list logo