From: Robert Sossomon [EMAIL PROTECTED]
And here is the additem.php file where it check for the info in the
field and it is erroring out.
It would be rather useful to know the error...
$get_iteminfo = select * from GCN_items where 'item_num' LIKE
'%$_POST[sel_item_id]%';
Take away the
From: Robert Sossomon [EMAIL PROTECTED]
The errors as it prints are:
The query I just ran was: select * from GCN_items where `item_num` =
'%fm-a294%'
The query I just ran was: Resource id #2
0
Those aren't errors; it's just what you asked the script to display. Your
query simply isn't
From: Dillon, John [EMAIL PROTECTED]
I want to show a number from a database in the format x,xxx.00 in a
textfield, then if it is changed by the user I want to post the value of
the
number to a decimal field. However, once you number_format the number it
becomes a string, and numbers like
From: [EMAIL PROTECTED]
could you cast as a float/double before inserting? $number = (double)
$string;
don't know what would happen to the comma, but i assume it would just get
removed??
Everything after and including the first non-number character would be
dropped.
So $12,000.34 would end
From: Peter Beckman [EMAIL PROTECTED]
On Wed, 5 Nov 2003, Dillon, John wrote:
I use this:
$x['funds'] = (int)preg_replace(/[\$,]/,,$x['funds']);
where $x['funds'] contains something like $3,249,555.32, and the end
result is an int of 3249555. I drop the cents... you want to keep
From: [EMAIL PROTECTED]
Unsubscribe
No thanks. I like it here.
---John Holmes...
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
From: [EMAIL PROTECTED]
sweet. thanks for hte correction. i try, sometimes i fail. :)
But trying is half the battle. GI JOE!
---John Holmes...
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
From: Douglas Freake [EMAIL PROTECTED]
I need to do a loop where the mysql query starts
at the bottom and goes up, as if the data was in
reverse order. This is for building a category/
sub_category menu.
Data structure: (cat_id, cat_sub, cat_name)
sample routine:
do {
$sql = SELECT *
From: Aleks @ USA.net [EMAIL PROTECTED]
First I build my select list:
SELECT NAME=Cid size=1
OPTION Selected VALUE=All Customers/OPTION
?
While ($Site = mysql_fetch_array($S))
{
$Sid = $Site[CID];
$SName = htmlspecialchars($Site[Customer]);
echo(option
From: pete M [EMAIL PROTECTED]
do not quite understand your problem.. pls post some code?
heres a small snippet that should work well...
$qry = 'SELECT `customer` FROM `customerList` ORDER BY `customer`';
$res = mysql_query($qry);
while($customer = mysql_fetch_object($res)) {
From: Boyan Nedkov [EMAIL PROTECTED]
Putting more than one table in the FROM clause means tables are joined,
then at least following problems could arise:
- using WHERE clause you can have empty recordset returned and then
COUNT conflicts with it because there is actually no any data to be
From: Evan Morris [EMAIL PROTECTED]
I have data in a database that may contain apostrophes.
Some databases use the backslash character as an escape character for single
quotes, while others use another single quote. Try your query such as:
SELECT * FROM Table WHERE name = 'o''mallery'
Instead
From: Jeremy Shovan [EMAIL PROTECTED]
All I did was rewrite it exactly the same as it was and the
parse error disappeared. I have never seen anything quite
like this before.
Seen this before. It's either the editor or a copy and paste operation
adding weird invisible characters. Major pain in
From: Peter Beckman [EMAIL PROTECTED]
I have this data:
Table Log: appid userid points datetype
Table Score: appid userid score
I want to verify that the last entry in table log of type x is equal to
the sum of the scores in table score for the same appid and userid.
Can
From: Becoming Digital [EMAIL PROTECTED]
php|cruise is coming this March.
Final word on this, I promise! :)
I'll be on the cruise, so I'm looking forward to meeting anyone else that'll
be there. Contact me offline if you want.
I wanted to say think you to all of those that contributed to the
From: Adam Williams [EMAIL PROTECTED]
This is my SQL query:
SELECT seriesno, governor, descr, boxno, year, eyear, docno
from rg2 WHERE seriesno = '$_POST[seriesno]' and governor matches
'*$searchterm*' or descr matches '*$searchterm*';
Looks like you're doing the equivilent to a MySQL LIKE
From: Robert Sossomon [EMAIL PROTECTED]
I have a form that allows for an item to be entered, the other pieces
have been fixed so far that were bogging me down, but now I am looking
for a way to convert any entry in the form to be UPPER case so that when
the quote is listed, they are
From: Adam Williams [EMAIL PROTECTED]
I'm using Informix SQL.
Could have saved some bandwidth by mentioning that in the first place and
only posting to either php-general or php-db (which is more appropriate),
not both. :)
Ignore what my other posts said, as I don't know how Informix works.
- Original Message -
From: mike [EMAIL PROTECTED]
I currently manage several websites that share the same code.
create a directory called inc in /usr/local/apache
and then add the following line to php.ini
include_path = .:/usr/local/apache/inc
I'd use a method like this, although
From: Chris Boget [EMAIL PROTECTED]
create a directory called inc in /usr/local/apache
and then add the following line to php.ini
include_path = .:/usr/local/apache/inc
I'd use a method like this, although I'd probably just use an absolute
path
instead of adjusting the include_path.
From: [EMAIL PROTECTED]
eregi_replace(a href=\(.+)\, a href=\\\1\ target=\_blank\
class=\down_txt\, $body);
How is that any different than just doing a str_replace() on a, though?
The str_replace() is going to be much faster than the eregi_replace()
function and href doesn't _have_ to be the
From: Larry Sandwick [EMAIL PROTECTED]
Is there a way to run a query so that it ignores the case, and the query
is not case sensitive?
What's this have to do with PHP and what database are you using?
---John Holmes...
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe,
From: Paul Ihrig [EMAIL PROTECTED]
how weird is this
just had to uncheck allow anonymous access.
and keep checked Integrated Windows authentication
just seems a bit silly...
every thing works fine now.
Of course it works because you're now running the PHP scripts as yourself,
and you
From: Roger Miranda (Sumac) [EMAIL PROTECTED]
Is there a way to permanently join/link two mysql tables?
Not without creating another table.
CREATE TABLE MyTable SELECT ... FROM Table1 JOIN Table2 ON ... WHERE ...
Although I have to wonder about your schema if you need to do this.
---John
From: Aaron Wolski [EMAIL PROTECTED]
I have data in a Db that looks something like:
14,[EMAIL PROTECTED],Andrew,Smith
1,[EMAIL PROTECTED],Andrew,Smith
14,[EMAIL PROTECTED],Barbara,Richardson
1,[EMAIL PROTECTED],Barbara,Richardson
The number represents a product_id that was purchased by
From: ShortStay [EMAIL PROTECTED]
How do you delete a value and key from an array? I know the value.
You need to know the key.
unset($Array[$key]);
There are various array functions that'll find the key for you if you know
the value.
Is it OK to post array questions to the db list?
Not
From: Ruprecht Helms [EMAIL PROTECTED]
how can I convert a date stored in a mysql-database for output
in the german format (dd.mm.yy).
I tried date (d.m.y,$row-from);
but I still get the english-format stored in the database.
The databasefield is type date.
That's because date() wants a
From: Hans Lellelid [EMAIL PROTECTED]
Using MySQL DATE_FORMAT() would work, but it's a hack solution; if you
ever wanted to create an English version of your site you would have to
make changes to your data-layer queries -- and that's just not where
that logic belongs.
So use UNIX_TIMESTAMP
From: "Will Contact" [EMAIL PROTECTED]
Now I am programming php+mysql. I put word, excel, mpeg and
any binaries into
the mySQL database using php on linux server,But I can take out these
binay
from mySQL database. I would like to see the files and save my pc from
From: antonio bernabei [EMAIL PROTECTED]
I need to make a join between two tables. And I can use the mysql_query
function: this is ok.
The problem arises because I need to apply a user defined function to a
field of one of the two tables and the rule for the join is WHERE
From: redhat [EMAIL PROTECTED]
I have a page that I put together that pulls in data for the time in
individual fields - hour, minute, am/pm, month, day. I am going to
alter the db to add year as well. I want to order this list by multiple
criteria - first by year, then by hour, am/pm,
From: Adam i Agnieszka Gasiorowski FNORD [EMAIL PROTECTED]
I cannot use this query
CREATE TABLE table LIKE other_table;
, which is supposed to create an
empty clone of the other_table named
table.
Was it added in some later MySQL version?
It's in the manual on mysql.com, bo no version
From: Gary Every [EMAIL PROTECTED]
Try:
CREATE table new_table SELECT * from old_table limit 1;
delete from new_table;
This will give you the same structure in both tables, and the
deletion will make the new_table empty.
Not quite the same as it will not copy indexes/keys...
---John
From: Larry Sandwick [EMAIL PROTECTED]
I need to sum the field *COST* in this query where data in *STATUS* is
equal to HELD and OPEN, so I will have 2 totals passed below and do
not know where to begin .
SELECT status, SUM(cost) FROM Table WHERE status IN ('HELD','OPEN') GROUP BY
status
From: Larry Sandwick [EMAIL PROTECTED]
I appreciate the quick response, but I should have been more clear.
I understand the query below, but I would only have 2 total and it is
not group by the companies.
The query below gives me the main information without totals.
How do I add the 2
From: [EMAIL PROTECTED]
is there a PHP function that wil return the names of the columns for a
given table?
http://www.php.net/mysq_list_fields
Note: The function mysql_list_fields() is deprecated. It is preferable to
use mysql_query() to issue a SQL SHOW COLUMNS FROM table [LIKE 'name']
From: [EMAIL PROTECTED]
I have a MySQL database, with around 500 entries in one table...
I've noticed that many entries have an erroneous ';' in the one of the
fields.
What I need to do, is tell MySQL to go through the ENTIRE table and find
any instances of ' ; ' and them delete
From: Monty [EMAIL PROTECTED]
I now get an error from MySQL stating that BINARYuser_name is not a
valid
column. So, something seems to be broken. I looked through the MySQL
online
docs and BINARY is still there, but, it won't work for me.
Maybe try putting a space between BINARY and the
From: Duane Barnes [EMAIL PROTECTED]
$output .= option value=$category$category/option;
Put quotes around your values...
If you have
option value=This and ThatThis and That/option
how do you expect HTML to know you mean This and That as you're entire
value? It's not. It's going to take This
From: Angelo Zanetti [EMAIL PROTECTED]
This might be slightly off topic but hopefully someone can help.
I have a field that is a varchar and I stored dates in it. But now I want
to
change the type of the column to date, but I have a problem that the
formats
differ:
my format: mm/dd/
From: Muhammed Mamedov [EMAIL PROTECTED]
Try this
SELECT DISTINCT(file_name), Count(file_name) AS cnt FROM $table_name
WHERE
date
BETWEEN '2003-10-01' AND '2003-12-31' group by file_name order by cnt;
desc
If you're GROUPing by file_name then you don't need DISTINCT(file_name)...
it's
What's this got to do with databases (PHP-DB list)? It's barely related to
PHP to begin with. Think about where your sending your messages before you
click the button.
---John Holmes...
- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, January 20, 2004
From: Larry R. Sieting [EMAIL PROTECTED]
what would be the most efficient way to rework this data in to what I am
after
stored text:
asdf asdf sadl jf lsakdjf a \r\n asdfierw aweiufasd asiuwr \r\n
asdhfauiweuhrahsd \r\n
displays text as:
asdf asdf sadl jf lsakdjf a
asdfierw
101 - 143 of 143 matches
Mail list logo