> 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
probably b/c of grants/rights
did you run a -- grant all on *.* to user@localhost ? or something of the
sort. or set up root to have access
can you connect via command line?
HTH
Jeff
that didn't cause me any issues on my install. why do you have to turn
that off. i'm not doubting you, just curious?
Jeff
"SELPH,JASON
the function takes a certian number of required arguments(or parameters)
and you're not passing enough. For this funtion it only takes one, which
is the ldap resource link identifier. which was probably set in $var =
ldap_connect("ldap_server"). here the resource link identifer would be
$var.
this can be done with Full Text Searchingdepending on DB compatability.
if you use mysql - http://www.mysql.com/doc/en/Fulltext_Search.html
HTH
Jeff
copy($_FILES['userfile']['tmp_name'],"/real/path/to/$_FILES['userfile']
['name']");
what you really want is...
http://www.php.net/manual/en/features.file-upload.php
hth
jeff
did you compile PHP with --enable-mime-magic? if not, this extension will
not work. there are work arounds. one isa class that resides on
phpclasses.org that will give you a mime based on the file extension. and
i'm sure there are other ways
hth
jeff
SELECT DATE_FORMAT(NOW(), '%m/%d/%Y'); will out put 01/04/2003. replace
NOW() with you're column name.
check out hte mysql manual for all of the date variations.
hth
jeff
I agree with this method. i have not yet seen an advantage of storing
blobs in a database. Is there one? i'm sure those on this list would have
an opinion if there was one. personally, i like storing all this stuff on
the file system.
Jeff
i know this is a bit down the chain, but i'm trying to keep the message
strings in tact
but can't you set up your directory just like you set up your mysql Grants.
I have a directory that the web user owns, who is in its own group. so i
set the permisssions once, and its done. Also i don't
does this have anything to do with register_globals being off. are you
using $_POST['var_name']? or $_GET['var_name']?
can you send some code?
jeff
"Jared
it seems to me that this is to much work for the output. not only will
ISPs add complexity, but since you are combining thee seperate items you
confining people to a single location. any laptop user may come in from
various ips and still be unique. I tend to stay with the information you
descri
$_SERVER['HTTP_USER_AGENT'] - contains most/all of what you need. if you
want color settins etc,. you'll have to include some javascript.
hth
jeff
Mignon Hu
if you're looking to do math in sql, i'd look to the mysql manual. lots of
great examples. basically same answer for php. i'd start there...if you
don't find what you're looking for .google.
www.php.net/math
www.mysql.com
hth
Jeff
check out DATE_FORMAT in the mysql manual. and acually you'll want
year-month-day not year/month/day...if you're using the mysql defualt date.
DATE_FORMAT(NOW(), '%m/%d/%Y') - would return 01/22/2003
hth
jeff
i forget exactly how to use it, but look up TOP. although it does not
perform like LIMIT.
hth
Jeff
"Grant, Dean
$sub_cat is an array so you can omit the pipe when you get to count
($sub_cat); with an if block. there my be an easier way though.
hth
Jeff
"Jami"
it IS 3306(in a default setup) that you'll need to allow traffic through
the firewall for this scenario. I have similar needs and that is the port
we open.
"
I would check the mysql is running. can you connect via telnet?
jeff
Matthew Moldvan
flash is server independent. if you call a flash file on another server it
is much like calling an image on another server.
yes, PHP can feed flash(info from a DB...to keep this on topic). And flash
can send back infomation to PHP via get and post variables(not sure about
the post). I've run i
sorry i don't speak (spanish?)...but this means you have sent information
to the browser before the header() function call.
even a space at the top of the page, before the opening ,
<[EMAIL PROTECTED]>,
<[EMAIL PROTECTED]<[EMAIL PROTECTED]>,
<[EMAIL PROTECTED]>
hello. sorry to have tried to guess at the language. I've received a
couple emails, some nicer then others. i had no intention of insulting
anyone, i meant no offense.
unfortunately i could not read his statement but knew his issue, luckily he
is smarter then I am, and understood my reply.
Je
Or if you want to change it when you're pulling out of mysql you can use
the DATE_FORMAT( ) function...
hth
jeff
John Krewson
You can take the selected items posted to your page and use in_array() to
search for the current item as your code creates the list. this is a chunk
of code that i use to do the same thing. I wrote this a long time ago, so
there may be better ways to do thisbut it works. ;-)
<>
if (in_array
This works as of 4.3 with fopen(https://myserver.com). but i dont' think
it works with file(https://myserver.com)...i may be wrong, of course.
HTH
Jeff
"R
personally, i think solutions are always worthwhile, no matter how trivial.
that way when someone is searching the archives, they will find the
solution in the thread.
just my $.02
Jeff
if you're using mysql you can use LEFT(column_name, 10) this will return
the first 10 chars of whatever is in column_name. you could also use
SUBSTRING(col, position, length)... i'm sure most DB's support variations
of the above.
hth
jeff
if i'm understanding you correctly, you're looking for this???
nl2br()
http://www.php.net/manual/en/function.nl2br.php
"John M."
www.phpclasses.org is your best bet. there are plenty. personally i use
this one..http://phpclasses.com/browse.html/package/32.html
check out his site for examples.
hth
jd
$qry = "SELECT * FROM TABLE_NAME";
$result_set = mysql_query($qry) or die(mysql_error());
***this has to be called before any headers are written to the browser.
***
header("Content-type: application/csv");
header("Content-Disposition: attachement; filename="YOURFILENAME.csv");
while ($record_se
may be missing the point. but
when you're brining down the page decide what records the user can and
can't delete and write javascript function(s) using php for the correct
scenario, I'd write a single js function that you'd pass one(many) PHP
variable(s) into, when building the page, after
mysql knows. this means your query failed, $command resulted in an invalid
result set. try adding: or die(mysql_error()); to any call to mysql_query
()so in your code use this:
$result = mysql_query("$command",$mysqlHandle) or die(mysql_error());
- and -
$resultw = mysql_query("$commandw
how about \0. yours is a foward slash not an escape. though that may
just be your post you can also use an unquoted NULL.
hth
jeff
if it is truley csv, then use MYSQL's "LOAD DATA INFILE" syntax. granted
you've got to have ahold of the text file.its not out of the box, but
pretty close.
Woudl that work for you?
http://www.mysql.com/doc/en/LOAD_DATA.html
hth
Jeff
Do you have an 'or die(mysql_error())' statement following your
mysql_query($result) line. 99% of the time, this error means your query
failed. if it works on another serverare the fields the same, the
dbname, the tablename?
hth
jeff
you could change mysql to a few different date formats, but i don't _think_
that is one of them.
Why not just take care of a format change on the way out with DATE_FORMAT.
Also, if you store the date as one of the defualt date[time] values then
you have tons of functions that you can run against
you'll need to use $_GET['id'] or you'll need to set register_globals = On.
I would use the first method, and replace
$query = "SELECT slug, content, contact, timestamp FROM news WHERE id
= '$id'";
with -->
$query = "SELECT slug, content, contact, timestamp FROM news WHERE id = '".
$_GET['id']."
If you have the standard table type installed
As you loop though though the arrays in PHP get ahold of the last ID
inserted via mysql_insert_id() and add it to an $inserted_array variable
and then at each insert check that the last insert was successful, and if
not send your db a bunch of dele
you can't use COL_NAME = NULL or COL_NAME = 'NULL' and get the desired
results , you have to check for IS NULL/ IS NOT NULLSo, change the
query to
SELECT * FROM TABLE WHERE MY_FIELD IS NULL or,
SELECT * FROM TABLE WHERE MY_FIELD IS NOT NULL
>From my understanding when you check for COL_NAM
this may work, but i hesitate, i've _never_ had to use exit to get my code
to excecute a redirect. and i'm heavily reliant on this function.
did aarons fix work for you? i think you're problem lies elsewhere. as
i've just mocked the same thing on my server, but using 10 instead of
03...i'm on
that why i love this list.
thanks
"John W. Holmes"
is it possible that there is no referer. what happens if you link to this
page from another, ensuring there is a referer, will it display it then?
Jeff
i have a feeling oyu're not getting a mysql error but a PHP error??? you
have an odd number of parentheses and mysql_error will not have an closing
paren.
if that is the case, try this
mysql_query("INSERT INTO Boats (Make, Model, Serial,Stock, Extension,
Cust_Name, Store, Date) VALUES
('$mak
if there are line feeds in the text, you can use the function nl2br($text);
www.php.net/nl2br
if you require more, you may have to add logic. around headers/titles
etc...
hth
jeff
yep, sure is.
SELECT DISTINCT(Unit), Count(Unit) from TABLE GROUP BY Unit
hth
jd
[EMAIL PROTECTED]
one thinglooks like you need one more outer set of paren's to tie both
sets of the equation together.
query = SELECT *, ((Year(Now()) - Year(BDAY)) + ((DAYOFYEAR(Now())
-DAYOFYEAR(BDAY))/365)) as AGE FROM Katalog WHERE AGE >= 31 AND AGE <= 50
AND IS_MEM_EXP = 0 AND IS_OPEN = 1 ORDER BY INPUT_
there are many ways to approach this.
one is, select the db before any of this activity with mysql_select_db
("dbname") then you can run as many queries against this database as you
want.
Until you call that function again with another db name, mysql with
_always_ run against that database.
hth
j
SELECT DISTINCT(Unit) from TABLE_NAME;
[EMAIL PROTECTED]
there is _definitely_ a MyOdbc Driver. i'm using it
Gerard Samuel
personally, i had luck with the statement below, but have sent it to others
in the past and they had varying results. but give this a shot at the top
of your page that your PHP code is running on.
mssql_query("set textsize 65536");
hth
Jeff
if i understand your question. why not take a different approach. when the
form is submitted do your updates/inserts and then forward the page with
the header() function to another page, even if it is the same page, but
with a different set of variables set on the page, the idea being to remove
t
best way to tell is to place .'or die(mysql_error())' after any call to
mysql_query() to see what mysql is complaining about. personally I
sometimes declare the query first so i can echo that as well after the
msyql_error() function, so i can see the query that has just been
excecuted. helpf
whoops, meant to include
thishttp://www.mysql.com/downloads/api-myodbc-3.51.html
[EMAIL PROTECTED]
This may or may not make sense for your issue. but if you have the whole
array in memory you can serialize() it and write the string that the
function returns to the file.
$fp = fopen("yourfilename.txt", "w");
$my_array_s = serialize($my_array);
if (isset($fp)) {
fwrite($fp, $my_array_s);
Sounds like you're on the right track. in the list, add -->
onChange="document.form.submit()" <-- this will submit the form when the
user selected the an option from the list, then you could catch the
submitted variable and pass it to the second drop down list and third and
so on. Realizing hta
if you're looking for a little more control over your documents, i'd try
this class. Its based on the WriteExcel Perl Module. Perl class docs can
be found
here--->http://search.cpan.org/author/JMCNAMARA/Spreadsheet-WriteExcel-0.41/WriteExcel.pm.
I've found _very_ few things for my needs that t
to my knowledge this is not possible in MySQL. There are only joins at the
table level. I've been curious about this in the past myself, so if i'm
incorrect, i'm hoping to hear it via this post.
hth
jeff
do you get anything helpful if you set error_reporting(E_ALL) and rerun the
search. could this be a register_globals issue? can you print_r($_GET) or
print_r($_POST) depending on how you have defined the FORM action...and if
you can is there anything in those arrays?
hth
Jeff
use mysqldump. you can dump all databases (--all-databases) or list them
individually.
http://www.mysql.com/doc/en/mysqldump.html
hth
Jeff
if its never entering hte test process maybe you're not holding what you
think you are in the arrays. each time through the loop, before the if
statemetn, just add a
print_r($shell[$cntr]) and/or print_r($grp[$cntr] == ""). for that matter
you could print_r both arrays so you can see exactly what
if you're using php to generate this query you could use addslashes() to
the piece that is holding 11301201 0603A HKA 3902 #3708_JD's
AE Exp. this will escape the slashes making them \'
similarly if you're getting \' in your return values you can use
stripslashes()
www.php.net/addslashes
www.p
$_SERVER['HTTP_REFERER']
hth
jeff
Diana Cassady
I'd worry about the empty dates after. and use something like.
$qry = "select date1, date2 from table";
$result = mysql_query($qry) or die(mysql_error());
while ($rs = mysql_fetch_row($result)) {
//this array could be built a number of ways, one is
$bookdate[] = array($rs[0],$rs[1]);
}
if
looks like you stopped putting commas after your fields at
$field_str .= " formation = '$formation' ";
$field_str .= " perfs = '$perfs' ";
$field_str .= " event = '$event' ";
$field_str .= " fluid = '$fluid' ";
hth
Jeff
the value will be what ever you set the value to be in your html tag.
if checked $_POST['color'] will equal "red". if unchecked, the index
'color' will not be in the $_POST array.
hth
Jeff
you could first check for isset($_POST['keyword']) and then if that passes
check what keywords you have. or you could write an additional html tag to
the page like. . This
would force the $_POST['keyword'] array to exist and then you'd have to
strip that from your array when processing it
hth
couldn't this be accomplished with a Left Join? Depending on how your
tables are arranged you should be able to get all (sub)sub-names out and in
the same result set using the top_name with a Left Join. any key that
relates to the parent key would be returned.
it looks like you have them all in
http://www.mysql.com/doc/en/mysqldump.html
"John Ryan"
couple possible problems.
1. register globals being off and you're using variables like $name instead
of $_POST['name'].
2. you're not asking that anything be written to the database, only
selecting
$insert="select * from $table";
$db_query=mysql_db_query($db_name,$insert);
3. yo
i asked this same question once and somehwere in the archives is a post by
John Holmes that shows an example of how mysql allows db joins. its from
last month i believe
http://marc.theaimsgroup.com/?l=php-db
but in short, mysql does support this using . db.table.field
hth
Jeff
I have two tables and am running a simple join between them to get
questions and their repsective response averages from a survey. The
question table has 49 rows and the Response table has 126,732. I'd like to
cut down on the time its taking to run this specific query...as i'll be
running many li
i new i forgot to include something.
here this is the ouput. it looks like its using none of my indexes in the
Response, which is where i would think it would need it the most.
+++---++-++++
| table | type | possible_keys |
Thanks Jeff!
You were correct the Question_Key was set second in the Primary key...i
changed that and the query went down to 2.41seconds. very nice.
Thanks for the help.
Jeff
ps. you're also correct about the LIKE, of course...that was being used
horribly. i'd forgoten it changed to an INT, a
I have a query that is pulling user comments, supplied by via web
internface and creating a text file out of them. In these comments are all
sorts of carrige returns. I've tried stripping them out with the following
queries, but once imported into excel, the carrige returns are still there.
so ob
I use Apache with PHP using MSSQL and MySQL at the same time...
You'd just need to connect to different databases, the platform should not
matter.
hth
Jeff
$qry = "SELECT id, name FROM a_table";
$result = mysql_query($qry) or die(mysql_error());
while ($rs = mysql_fetch_row($result)) {
$myarray[$rs[0]] = $rs[1];
}
is that waht you need?
hth
Jeff
$fieldarray = array("one","Two", "three", "four");
$line = "\"".implode("\",\"",$fieldarray) ."\"";
this will print out "one","Two","three","four"
hth
jeff
OS Solaris8
php4.3.2 and php 4.2.3. running as CLI from cron and command line.
I have a log file that i'm processing that i need to in turn insert only
certian fields into the database. I open the files using
file(filename.csv),which returns the array for me to process. i process
all the lines
do you just need a /
$AcceptedFolder= 'F:/';
Karen Resplendo
hmmm. thanks for this. the file actually does not have quoted entries
between the commas. it is just:
text,text,text . ,text \n
that does not take away from the assitance...gives me more things to think
about.
thank you.
jeff
The crux of the problem seemed to be that i was ftp'ing files down from
remote servers(1 to 4 depending how many are currently active), saving them
locally and then parsing those files in the same script. When i removed
the ftp process from the code and broke the process out into two seperate
cod
there are trim functions in both mysql and php.
both they are called the same...trim, ltrim and rtrim. trim takes off both
sides, and the r and l take the right and left respectively, but yes, this
is possible in the query.
http://www.mysql.com/doc/en/String_functions.html
php.net/trim
php.net/l
ahh, yes...but you didn't say mysql...sorrythey all have this function.
[EMAIL PROTECTED]
lots of people seem to post/think different things, but each time Rasmus
posts to these lists, he says PHP/Apache2 is not a production ready combo.
if you search the PHP-INSTALL archives for his name or Apache2, you'll find
his posts.
hth
Jeff
--
PHP Database Mailing List (http://www.php.net/)
'tested' is the key. hopefully you don't test in production ;-) his
point has been that you may not notice the problems until the servers get
under heavy load.
i've got two such setups running myself. but not in production.
jeff
question/comment...
i don't use PEAR currently. but i noticed this class expects
register_globals=on and would therefore not to work on my system.
Or does another parent class take care of the translation between $form and
$_GET['form']?
Jeff
not to belabour this topicbut, that i know. i was just curious as to
why that class is written like that still?
it seems that if PEAR does this for you(extract), that _may_ be a security
concern for those that are not being security concious.
Not that i'm saying, or know, that PEAR does thi
this should fix ya..
http://www.mysql.com/doc/en/Resetting_permissions.html
hth
Jeff
Joffrey Leevy
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??
just a guess/thought
Jeff
sweet. thanks for hte correction. i try, sometimes i fail. :)
"CPT John W.
if you want actual errors that PHP generates and not logic based errors,
then writing your own error handling function and calling it with
set_error_handler() at the top of your scripts may work for you. in your
function you'd just need to use $errorstr, $errorfile and $errline and log
it using
i'd be curious what your actual problem is?
here's a question though.,...would these ever work?.
>>
if ((!isset($_POST['edit'])) or ($_POST = "")) {
$_SESSION['table'] = "t_items";
call_user_func("db_retrieve");
} elseif ((isset($_POST['edit'])) or (!$_POST = "")) {
<>>
You
jpgraph does a fantastic job of this, and is very easy to use. I highly
reccomend it!!
http://www.aditus.nu/jpgraph/.
hth
Jeff
"Hull
if you can connect via odbc, you can use php with it.
i just googled -> paradox, database, php
and the first link will answer your question.
ps. Rosen your email bouncesunknown user.
error --> 550 5.1.1 <[EMAIL PROTECTED]>... User unknown
hth
jeff
- Forwarded by Jeffrey N Dyke/CORP/Kean
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
101 - 200 of 205 matches
Mail list logo