this is usually based on what your passing this function. it can be a
result of a bad query or just a bad variable. do you have the correct
variable that is holding a result of an ifx_query() call.
if you could post the prior lines of this that would probably make it
clearer.
also try var_dump
you can use freetds (http://freetds.org) i think there is even an rpm...
Then you just use the mssql_* functions built into php
hth
Jeff
if you're using mysql
php.net/mysql_insert_id
if you're not, there may be a variant for you db
hth
Jeff
"Webmaster
www.php.net/mail
redhat
the web process does not have access to write the directory that oyu're
moving the file to. in this case ./images/exec/. most likely you'll need
to either chmod o+w ./images/exec (give the world the write right) or
change the owner of that directoyr to be the web process. both come with
their o
Hey Todd.
I'm no guru...but have some familarity with these packages. i think you
could remove the php rpm with rpm --erase php* and then recompile. being
from other OS's myself, mainly solaris, i find it easier to build my own,
mainly b/c i know when it works and when it does not.(still a RH n
you've just about got it in your question.
SELECT * FROM MyTable WHERE Field1='test' OR Field2='test2' ORDER BY
TIMSTAMP DESC LIMIT 1
hth
Jeff
http://www.php.net/mysq_list_fields
hth
Jeff
"Shaun"
using mysql as an example, this is what i do.
---UNTESTED CODE --
$sql = "SELECT * FROM TABLE";
$res = mysql_query($sql) or die(mysql_error() . "".$sql);
$fp = fopen("file_to_create.csv", "w");
while ($rs = mysql_fetch_row($res)) {
$write_string = "\" . implode("\",\"", $rs) . "\" \n";
>When returning to the main page of my script sometimes I'll get the
>following error:
>Warning: mysql_fetch_array(): 8 is not a valid MySQL result resource in
>/home/nick/http/search/includes/main.inc on line 13
>This happens only AFTER the first element in the resource has been
>processed.
An interesting thought. I tried this:
echo "Term: $search, Returns: $arrayword, UserIP: $ip";
$logit = mysql_query("INSERT INTO log SET term='$search',
returns='$arrayword', time=CURTIME(), date=CURDATE(), ip='$ip'");
echo "Query Value: $logit";
And got this on the page:
Term: skater, Retur
Ok guys, I found the problem. It's actually something I've run into
before. If you take a look at the query you'll notice that one of the
fields is named "returns". When I created the test table with phpMyAdmin
it created it and everything seemed fine. Then I decided to try
something. I tweaked
On Thursday 04 March 2004 08:08, Rich Hutchins wrote:
> Oh, and, normally, you reference the variables like so:
$_POST["varname"].
> I typically use the following syntax:
>
> "INSERT INTO tablename
> VALUES('".$_POST["varone"]."','".$_POST["vartwo"]."');
>>IMO it is better to use the braces sy
Gamze Başaran
<
I'm working on a project that takes the content of a URL and does stuff
with the content. I've managed to extract the target url's html, and am
using str_replace to fix links, stylesheets etc. However, i'm stumped when
it comes to processing the text content.
Would anyone know how to isolate dis
I have a table:
CREATE TABLE `cashmire` (`id` smallint(3) unsigned NOT NULL auto_increment,
`itemcode` varchar(25) NOT NULL default '', `collection` char(2) NOT NULL
default 'cl',
`promotion` char(1) default 'n', `bestSeller` char(1) default 'n',
`newArrival` char(1) default 'n', `size` varcha
Why is it when I have this ` tick mark in my query it works fine, but
when I remove them it I get an error?
___
This tells to mysql to NOT treat the word as the reserved word that it
_may_ be, but use it literally. and interval, i believe, is a reserved
word. It is much like escaping
Do you set the content-type in the response header like in JSP and
servlets?
I've been reading the PHP Manual; where do you find stuff like this?
take a look at the header function
http://php.net/header
an example...ymmv
header("Content-type: application/vnd.ms-excel");
header
>I am trying to update a database that I use to store user names and the
hashed values of passwords. The database name is Login, the table is
"users".
>I have the following commands in my php file.
>@ $db=mysql_pconnect('localhost','apache','password');
>mysql_select_db('Log
>No solutions or feedback?
>:(
>-Tom Reed
>[EMAIL PROTECTED]
_
How do you select _all_ the images from Folder B? Can you show that
statement?
In every delete you're able to do against a database table, you should
first be able to run a select and basically repl
>I am accumulating way to many PHP files in my home directory. It is
>very difficult to sift through all the files.
>I use a lot of "includes" and "requires" so it is difficult to organize
>them in folders even if I change back a directory with my requires
>using "..\".
>Does anyone know of a b
>Hi there:
Hello,
>I am looking for an open source and simple PHP script that will graph
>(bar) a few MySQL fields. Does anyone have any recommendations?
I'd suggest the jpgraph OO lib. Very easy to get simple graphs up and
running. so long as you have gd/jpeg available to your php. With so
>$result=mysql_db_query("usr_172_1","UPDATE artikel SET Preis='\$preis\'
WHERE ID='\$id\'");
>//mysql_error($result);
Here you're escaping the $ and then the ', have you tried
$result=mysql_db_query("usr_172_1","UPDATE artikel SET Preis='{$preis}'
WHERE ID='{$id}'");
with those escapes th
>Hello all,
>Am I right in thinking I have very few options? I don't want to move
over to ASP (would that even help?) because it means learning VBScript and
I don't have a >lot of time. Also, I can't use another database (e.g.
MySQL) cos the server admin is NOT helping me and won't install
> Warning: mysql_result(): Unable to jump to row 0 on MySQL result index
4...
> Now this makes some sense; the manual says that
> mysql_result ( resource result , int row )
> will jump to row $row in the output but says nothing about returning me a
> given fields.
> Any other thoughts?
H
>Hi, all --
>I have some code which looks about like
> if ( $_POST['signup']['referrer'] ) # a friend?
> {
> $q = "select InvitedBy from customer where EMail
= '{$_POST['signup']['referrer']}'" ;
> $r = mysql_query($q,$dbro) ;
> $row = mysql_fetch_array($r) ;
>Thanks pepole.
>I've tried but still does not work.
>when I put the varaibles name between ' '
>I found this error:
>Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
>`T_NUM_STRING'.
>I typed in this way
> print "VALUE='$_POST[UserName]'>";
This is pre register_g
hi,
>header("Content-type: application/vnd-ms.word"); is not what my customers
>want. They may or may not want to save it in their harddisk.. but having
the
>header at the beginning of my page will force them to save it in their
>harddisk. Some of the customers just want to view it on the web wh
>>Hi. You left out the 'php' after the '
See if that helps any.
~Philip
>
>
>
>
> print $action;
> print $Name;
> ?>
>
>
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Database Mailing List (http://www.php.net/)
To un
>Dear all,
>Can you aswer for the Query as follow :
>if(isset(_POST['VARIABLE1']$$(_POST['VARIABLE2'])
>{>print "testing";
>STATEMENTS;
>}
I'm not sure how this is not throwing a fatal error. Why do you have two
$'s in the middle and no $ preceeding variable names?
does this work?
if(isset($
>How can I query a MySQL table to get the latest results from a date field?
>Basically, I am inserting several records at a time at the end of each
week.
>I want to have a page that displays the results for the last week only.
>The date format in the field is -MM-DD
if you want the latest
> Hi there everyone,
Hello.
> I've been looking on Google for PHP Javascript tutorials but I can't find
> any. I'm new to Javascript but can use PHP for what I need. I was
hoping
> someone would know of a tutorial that would show how to use PHP to get
2-3
> datasets which javascript can then u
I have some procedural code that i'm wanting to convert into classes(and
i'm a bit greeen to OOP), hopefully to offer them to the PHP community. I
keep all my config data in arrays of arrays, which i'd like to keep when i
move to a class model, but can't seem to find out the correct defintion
synt
On Wed, 30 Jun 2004 14:20:52 -0400, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>
> I have some procedural code that i'm wanting to convert into classes(and
> i'm a bit greeen to OOP), hopefully to offer them to the PHP community.
I
> keep all my config data in arrays of arrays, which i'd like
> I'm using php addslashes to store data into MySQL and php stripslashes
when
> pulling it back out, but I'm running into trouble when people enter HTML
> code. Do you have any recommendations?
> Here's an example of what I'm talking about:
> ">
> An error occurs if the entry has a value of:
accidentally replied only to karen.
> The database queries all the sources at night after everyone has gone
home. That means the data was current as of yesterday. This little snippet
below returns yesterday's date, except that the first day of the month
returns "0" for > the day. Now, I know why
> I'm using PHP with mySQL since a long time.
> But now I got a question:
> I need to generate a SQL-Statement to fetch rows with one DISTINCT
criteria.
> To make things clear: I don't want to fetch a single DISTINCT column, I
want
> to fetch the whole row, where one column is DISTINCT.
> Ca
> I think I got it correct got the most part. I am having a problem with
> the urlencode function I believe.
> On page CustomerAddNew1.php ( page than handles form data ) im using:
> $last_id = mysql_query("SELECT LAST_INSERT_ID() from customerinfo");
> $last_id = urlencode ($last_id);
Why en
>Okay, I am new to PHP but very good with many other scripting languages.
>I use 'mysql_connect("localhost" yada yada'
>to connect to a database from the domain but I want to put this code on a
few sites and have it access one database >on the primary domain.
>How do I write that command? I
> I'd really like to find a Linux distro that is a LAMP system right out
> of the box.
> (Linux, Apache, MySQL, PHP)
> Are there any out there?
You should be able to activate all with Fedora and SuSe, from the disks.
You may still have to build PHP(on FC?), but IMO you'll want to do that
anyway
>>
>> I don't know how you have it setup.
>>
>> But you can create a XLS file on the fly using PHP
>>
>> By using header...
>
>> header("Content-Type: application/vnd.ms-excel");
>> header("Content-Dispostion: attachemnt; filename='Project.xls'");
>> header("Pragma: no-cache");
>> header("Ex
> I'm trying to pull all the records from the table class where classID is
> not equal to the value of classID in the table assignment.
> Currently, I have 'select class.classID, class.classDesc from class,
> assignment where assignment.classID >= class.classID and
> assignment.assignmentID=$ass
Hello.
I have recently installed the freetds package and reconfigured PHP to
connect to MSSQL. I am running a simple join query on two tables and I get
the following error.
Warning: Sybase error: 'REQ' is not a recognized OPTIMIZER LOCK
HINTS option. (severity 15) in myFile.php on line 29
RE
No thats not it. I connected above this line. All of my errors come as
Sybase errors because of the install of freeteds used with the
--with-sybase=/path/to/freetds flag when i configure. It actually ended up
being a spacing problem where i had concatenated the query string. there
were two wor
everything you need to know.
http://www.php.net/manual/en/ref.mail.php
Hope this helps
jeff
"Natividad
Someone, in their infinite wisdom, named some, not all of course, tables
and columns with spaces, i.e. BUSINESS AREA in a SQL server database that i
am working with. You can run lots of queries that return fine, but when I
run a query such as "select * from REQ where BUSINESS AREA = '$var', i ge
Don't i agree! I didn't create this database. and I don't use spaces for
anything. that is always good pracice, but since these folks had...here is
what i found.
The [ ] notation, works fine on tables, i.e. [BUSINESS AREA] but when
you have a column with a space then use this notation [BU
I love how this keeps getting answeredwere is just spelled wrong. it's
so funny that we all miss that though. i did a couple days ago and
responded with my own solution that didn't matter, b/c i still didn't spell
where correctly.
:)
I have have developed a statistics package that tracks user info(browser,
os, colors, heights, widths etc) as well as where and when they use my
various sites.
in the tables there are about 40 hits of aproximately 7,000 that the
broswer entry is PHP/2.0 and PHP/1.2 only.
Normally an entry looks l
ok, i have a query that is like so
select distinct(id), MIN(time), MAX(time), count(page), ip,
(UNIX_TIMESTAMP(MAX(time)) - UNIX_TIMESTAMP(MIN(time))) from trainingHit
group by id
and i really want to sort on the time difference, but i get an error that
states invalid use of group function i
for mssql(for Unix and linux) you need to install the sybase
libraries(freetds) and configure --with-sybase=/path/to/sybase so i the
MAC you must have to do something similar, but i have no idea what.
Hope this helps.
Jd
www.freetds.org may have what you need
"Chris
all you have to do is put one query per line in the file, it may be hard to
read, but who cares.
and then it is as simple as.
$contents = file("sql.txt"); //file function reads file into array
while (list ($qry)) = each($contents)) {
mysql_query($qry);
}
Just a thought
Jeff
although this goes without saying but in my petty need for completion, i
feel i must writethere is obviously SO much more that can be done where
i put the mysql_query($qry), whether it be updating, inserting, selecting
etc... but that can be a starting point.
i feel better, thank you for your
is this from within the browser? if so, you'd need to open the file, read
the contents and execute the script. I don't knwo what 'source' does. but
i don't claim to know much either. i may not have heard of this.
if you just want to do it from a command line then you use a < after your
login
The method is right, for your form, the problem is the lowercase $_get, I
believe. use $_GET['formfield']
Jeff
"Mike Germain"
This is how i do the same thing as i belive you're asking.
$result = mysql_query("select max(id) from [table]");
$lastID = mysql_result($result, 0);
Hope this helps
Jeff
I'm posting info into a SQL Server from a form, all has been working fine
inserting, updating and selecting information for months. I have recently
added a date field to the table with the type of datetime. It updates the
table in SQL Server fine, but it keeps pulling it back as this date [Feb 0
Hello. I was curious if any one is using PHP4.2x with SQLserver 7(or 2000)
and having luck with the datetime type. No matter the datetime in the
database PHP 4.1.2 is always returning Feb 06 2036 6:37AM . The insert is
correct, its only the select that this happens on.
There was a bug report,
Is this a issue with register _globals = off. try referencing it with
$_COOKIE['user_data'].
Also isn't 3600 only an hour. 60secs * 60mins? i think 6 weeks would
be... 151200 60 * 60 * 42days
does that work?
Jeff
I break up the search words using a function and then build a query based
on the search criteria. If it is multiple words, I use REGEXP for the
search.( I use a mysql database). then when there are multiple searches
you can format the query string like
SELECT show_name FROM table_of_shows
instead up supplying 'localhost' in your mysql_connect() function just use
the full name of the server i.e mysql_connect("www.domain.com" $user,
$pass) you must ensure the port is open through the firewall, if
applicable, and that you have a user set up with that can access it from
another domai
has anyone had any expierence with the datetime field coming back from
MSSQL as someting along the lines of February 3, 2036 6:36AM. This happens
to me no matter the time in the database. PHP inserts it correctly, but
the select has a problem. I am using php4.1.2 and SqlServer 7.0.
Or is anyo
but you said this problem was the holes, what happnes when you fill an
auto_incement number in a 'hole' then the next number exists... does it
skip the next number(501) because it exists or does it give an error saying
duplicate entry for primary key???
It just seems to make sense to me that you'
add an... or die(mysql_error()) to the $resultm = mysql_query($sqlm);
statement and you'll have a lot more info for yourself, and the list if
you still need assistance.
If you are running Apache and have access to the httpd.conf file. Comment
out AddModule mod_autoindex.c and restart apache. if you like this for
some of your directories, then I'd follow Jason's advice. If you are using
IIS or another server, I'm sure the same option is available, but I'm just
if you put quotes around the variable $PHP_SELF it should work...try this.
UPDATE $table SET pages = '".$PHP_SELF."' WHERE session = $holy_cow
hth
jd
"Jas
if i'm reading right, you could use a join to get all of that info.
select users.group_id, user_id, user_name, groups.group_name from users
inner join groups on (groups.group_id = users.group_id) group by
users.group_id
parens not needed, it just makes it more legible.
that should give you an
I have five enum fields, all Y/N. There is now(last minute) a requirment to
report on all clients that said Y to more then one of the questions(its a
survey). Had i known about this requirement, i could have made them BIT
and had a simple 1/0 option and summed the fields to check the total
s
use
this will send an array to your script.
|---|
| Jeff | KeaneIT - Presidents |
| Landing | Suite: 200 |
|Outside: 617 -517-1772 | |
| E-mail: [EMAIL PROTECTED] |
|[ Mailing: 10 Presidents |
| Landing Medford, MA 02155 USA|
|
Thanks for the responses. I got one earlier that did the trick. I wanted
to try as hard as i could from altering the table, as i was already using
the Y value in other reports...and here is a great solution.
this may help someone else. so I wanted to post it. I'll use it again, i'm
sure
SELE
if you are using mysql, it doesn't support the sub-select.
"Wilmar Perez"
unlink()
|---|
| Jeff | KeaneIT - Presidents |
| Landing | Suite: 200 |
|Outside: 617 -517-1772 | |
| E-mail: [EMAIL PROTECTED] |
|[ Mailing: 10 Presidents |
| Landing Medford, MA 02155 USA|
| ] |
|-
if you mean the rows switching colors i use this. in this example i'm
getting data from mysql
$rs = 0;
for($i = 0; $i < count($rs); ) {
while ($rs = mysql_fetch_array($result)) {
$bgcolor = ($i % 2) ? 'blue' : 'black';
//do stuff
$i++;
}
}
then $bgcolor goes
register_globals=off in your php.ini
turn it on, or use $_POST['FName']
|-|
| Jeff | KeaneIT - Presidents Landing |
| | Suite: 200|
| Outside: 617 -517-1772 | E-mail: |
| [EMAIL PROTECTED]|
| [ Mailing: 10 P
For what its worth. I wrote to the MySql folks asking about a production
release date and the reply was that they consider the latest in Beta, and
according to them, that is 'production ready' as it has gone through adn
passed all their rigorous testing. Have I upgraded yet? No. But, I've
seen
does the mysql section show up in phpinfo() ? is [shared] allowed in that
configure argument?
|-|
| Jeff | KeaneIT - Presidents Landing |
| | Suite: 200|
| Outside: 617 -517-1772 | E-mail: |
| [EMAIL PROTECTED]
I think this is how it works.if you're using dbx then you need to
connect using dbx_connect and not mysql_connect
and i don't think that [shared] is a valid argument.
I only connect to mysql and M$Sql so i have configured to connect to those
specifiacally.
I would reconfigure using -with-m
i'd get rid of the space as well, or use brackets around the db name to
account for the space.
"John W. Holmes"
sorry i mis spoke, the brackets will help you in queries with tables and
columns that have spaces, not in the connect with actual dbs(at least i
don't think so).
- Forwarded by Jeffrey N Dyke/CORP/Keane on 10/14/2002 11:40 AM -
what are you passing for module(the first argument for dbx_connect) it
should be DBX_MYSQL, or mysql, if that fails, recompile without the shared
argument, and i bet that would work
I belive $_cookie is different then $_COOKIE
Jeff
Steve Dodkins
to upload use copy and the $_FILES array. then around mysql, I tend to
store the path in mysql and the images on the server. I personally don't
like to work with blobs and don't think it makes as much sense as they do
on the server. the space they take up in the db seems like a waste.
my $.02
I am in the process of upgrading my UNIX hardware and moving web sites from
two different servers on to one server. I am curious as to opinions about
moving/replicating the databases and peoples experiences. For the two that
i have already done, i have taken a rather manual approach which was e
thanks guys. that is how i planned to do it, but i wanted to hear this
from others. This is how i accomplished the other two moves. sometimes
you just want to see if anyone has a better way. and the file copy method
just seems to easy, it almost seems wrong ;-), but it doesn't stop me from
u
select distinct Date from table_name where name = 'Test';
Jeff
"Chris Grigor"
I think this is only available as an option if you are running on windows
based hardward, but if you are...i know i've seen it in the manual.
José Moreira
yes this works. if your code is going to remian on Unix you'll have to
install freetds (www.freetds.org). there are instructions on
www.php.net/mssql for install in the comments...
when you get to the site(freetds.org) I know it says Sysbase..but it is
what you're looking for.
hope this hel
I'm sure there are a hundred ways
$rs = 0; // record set array
for ($i = 0; $i < count($rs); ) {
while($rs = mysql_fetch_array($result)) {
if ($i ==0 ) {
//do first thing
} else {
//do other things
}
$i++
}
Jeff
what was the error?
"dwalker"
,
how about a default value...so if you use a CHECKBOX_FIELD1 ENUM('Y', 'N')
DEFAULT N type of definition, then if box is not checked, then it will
deault to N otherwise a Y will override the default.
just a thoughtdont' know if it will work for you or not...
Jeff
it looks like you have defined $ADDDATE and it is not a posted variable.
what happens if you just have:
Jeff
David Jackson
did you restart apache?
epeloke@echoma
n.com (Edward
Hey arron...
can you send the the set cookie code and set up of your servers. this works
fine on a site that i'm working on. I have the https running as a
virtualhost in apachemust be an easy fix.
jeff
|---|
| Jeff | KeaneIT - Presidents |
| Landing | Suite
you need the exact same parameters as you used to set the cookie.
http://www.php.net/manual/en/function.setcookie.php
"Seabird"
further down in the manual it says.
-> Cookies must be deleted with the same parameters as they were set with.
http://www.php.net/manual/en/function.setcookie.php
You're close, from what i can see
just remove teh [ ] after the userfile or account for the fact that it is
an array, but if you only have one file then you don't need it...and
secondly, you're not calling your file anythign...you need to provide it a
nameunless it defautls to the tmp_name
Agreed. we prove day in and out that the answers are only an email
away...why would anyone go a different route. manual? whats a manual?
There are some brilliant people on this list, but some equally intelligent
people wrote some fine documentation.
isn't $order_index[$i] only one index? or is it multi dimensional?
"Aaron Wolski"
1 - 100 of 205 matches
Mail list logo