to $0 (bash) in php ?
The constant __FUNCTION__ will give you this.
-Stut
--
http://stut.net/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
missions when it comes from a different subnet. Check the MySQL
manual for detailed info on permissions.
-Stut
--
http://stut.net/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
7; where Record='1'";
Simple right? Not quite...in my database it's storing a "0" in the
timestamp field which is a int(10) field.
I have googled, and searched manuals, but have not been able to
figure out what is going on
Any Ideas?
timestamp is a reser
print a resource
you get the text "Resource id #n" where n is replaced with its ID. To
make use of this resource you need to use functions like
mysql_fetch_array, mysql_fetch_assoc or one of the many others
detailed in, you guessed it, the manual. Try it, you might like it.
-Stut
working try entering
';delete * from gig;select * from gig where Name='
(including quotes) into the gig_name form field. When you get over the
loss of all your data go read about sanitising your input: http://php.net/mysql_real_escape_string
-Stut
--
http://stut.net/
I am creatin
d to use == to do that.
I would suggest you buy a book on PHP for beginners, or Google for an
introductory tutorial because these are pretty basic syntax mistakes.
-Stut
--
http://stut.net/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On 6 Feb 2008, at 14:45, js wrote:
Use PDO and try/catch.
I think it's much easier.
Easier than checking the return value for FALSE?
OP: The manual is your friend, it tells you exactly how to detect
failures from any function.
http://php.net/mysql_connect
-Stut
--
http://stut.net
ssue there.
You're using === which does a type *and* value comparison. I'm guessing
that the MySQL driver does the conversion to an integer, whereas the
PostgreSQL driver doesn't. Change it to == and it'll work just fine.
-Stut
--
http://stut.net/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
ail->Send())
{
echo 'Message was not sent.';
echo 'Mailer error: ' . $mail->ErrorInfo;
}
else
{
echo 'Message has been sent.';
}
}
You're re-using the same message each time around the loop. Each time
you call AddAddress you're, erm, adding
to format this would be greatly appreciated. The mySQL db
column TYPE I am calling is Blob not null.
-Stut
--
http://stut.net/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
ff,
but I don't think that's likely to help you.
It sounds to me like you want hand-holding through the development
process. I can do that but I'd expect to be paid market rates!!
There are lots of resources around this area all over the Internet. I
suggest you use Google to
with PHP. I suggest you find a
beginners guide to the OS you're using and do some research on how to
run a daemon.
-Stut
--
http://stut.net/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
is a string';
$certainlength = 5;
$pos = 0;
$stringlen = strlen($string);
$array = array();
while ($pos < $stringlen)
{
$array[] = substr($string, $pos, $certainlength);
$pos += $certainlength;
}
// $array now contains an element for every $certainlength characters
// in $
code with get_lock() and release_lock(), to make it quasi-atomic.
Thanks for the suggestion, and thanks to Charles Morris as well for his
response.
No problem, but please include the list when replying in future.
-Stut
--
http://stut.net/
--
PHP Database Mailing List (http://www.php.net/)
To
pure SQL solution, but it will work. You
may also want to add a timestamp row to allow for a timeout on the lock.
-Stut
--
http://stut.net/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Stut wrote:
Chris wrote:
Stut wrote:
Chris wrote:
Rob Adams wrote:
I have a query that I run using mysql that returns about 60,000
plus rows. It's been so large that I've just been testing it with a
limit 0, 1 (ten thousand) on the query. That used to take
about 10 minu
Chris wrote:
Stut wrote:
Chris wrote:
Rob Adams wrote:
I have a query that I run using mysql that returns about 60,000 plus
rows. It's been so large that I've just been testing it with a limit
0, 1 (ten thousand) on the query. That used to take about 10
minutes to run,
elds you need. You may also want to look into changing the
cursor type you're using although I'm not sure if that's possible with
MySQL nevermind how to do it.
-Stut
--
http://stut.net/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
ist out
all the products, ordered by title but listing out all the Cats products
first. Any way to do that without having separate statements?
Thanks...
select * from productgroup where groupid = $productid order by (label =
'Cats') desc, title
And I do hope you're properly va
are no errors and you are still
getting different results from the script and from QA with the same SQL
statement then by definition something *is* different.
-Stut
--
http://stut.net/
>>> Stut <[EMAIL PROTECTED]> 6/28/2007 8:30 AM >>>
William Curry wrote:
> I have iss
the contents of
$variable? If so that's never going to work. Try this instead...
"SELECT * FROM tblX where value like '".str_replace("'", "''",
$variable)."%' "
-Stut
--
http://stut.net/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
e highly appreciate.
The only reason I can see to do such a thing is to build a brute-force
password cracker, and seeing as you're not smart enough to realise that
you can do so incrementally instead of randomly, I don't see much reason
to help you.
Enjoy.
-Stut
--
PHP Database Mai
cords, do the following...
foreach (explode(',', $single_result['name']) as $name)
$arr_all_names[$name] = 1;
Then after the loop, to get an array of the names...
$arr_all_names = array_keys($arr_all_names);
-Stut
--
PHP Database Mailing List (http://www.php.net/)
To
bedul wrote:
nope.. that's can be dangerous
since some activeX today are a food for a worm..
be safe on NET
It has absolutely nothing to do with security. It's all about patents...
http://channel9.msdn.com/ShowPost.aspx?PageIndex=2&PostID=169255
Fight the FUD.
-Stut
ot receiving what it expects either.
Does anyone see what I'm not doing right here?
Just because the query returned a resource ID does not mean it contains
any results. An empty result set is what you're getting, and you need to
check for that before trying to use the results.
Java version.
I already installed an php-accelerator (eAccelator) which increased the
overall performance, but still the performance is quite poor.
Are there any "tweaks" to tune PHP performance?
Don't use Windows.
If you *must* use windows, use FastCGI.
-Stut
--
PHP Database
g the doors rather than putting
5-minute obstacles in the path.
-Stut
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
an offering in this area:
http://www.zend.com/products/zend_core/zend_core_for_oracle
-Stut
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
HP5 can be built against libs for MySQL 4 or 5, so just make
sure that you match the version used for PHP to the server version and
you'll be fine.
Thanks for your help, Stut!!!
No probs.
-Stut
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
have a MySQL 4 client in there? If
that is the case, how should I rebuild PHP?
Yes, and it depends on what OS, where it originally came from, etc. The
alternative is to change the password of the MySQL user you're using -
the link in my last post explains how to do this.
-Stut
-
eturning to PHP after 5 years of not writing in it.
This basically means that you're trying to access a MySQL 5 server with
MySQL 4 client. You have two choices...
1) Rebuild PHP with the MySQL 5 client libs
2) Use the old password mechanism in MySQL
See here for more info...
http:/
Tim McGeary wrote:
Please include the list in replies.
Sorry, I meant to, but hit the wrong button.
Tim McGeary wrote:
Stut wrote:
Tim McGeary wrote:
I am new to this list today, so if I should be sending this to another
specific PHP list, please let me know.
I am getting the following
s the user that Apache (or
whatever web server you're using) runs as have access to mysql.sock?
-Stut
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
e following and adapt what the book is
giving you to work without it. Reasons for not enabling register_globals
are also given on this page...
http://php.net/register_globals
-Stut
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
" rows="1" name="problem_eb" >?>
Also worth mentioning that you may run into problems if you don't use
htmlentities on $problem_val, like so...
cols="1" rows="1" name="problem_eb" >htmlentities($problem_val); ?>
-Stut
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
bution that need to be on the
path for MySQL to function.
You may also want to check that where you've put php.ini is where PHP is
expecting it to be. A phpinfo() page will tell you that.
-Stut
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
() in Test.php on line 3" is returned.
>
> $conn = mysql_connect('localhost', 'root', 'password')
Installing MySQL is not enough - you need to enable the mysql extension
in your php.ini.
-Stut
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
ame itself is
sent.
-Stut
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Tue, 19 Sep 2006 03:30:24 +0100, Ron Piggott (PHP)
<[EMAIL PROTECTED]> wrote:
I realized this is off topic; I am not sure where I would look online.
Off topic? It's not even in the same continent!! Try a Linux mailing list
- that's what they're there for!!
-
e of a function to a variable if you want to
access it as an array.
-Stut
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
it that way is that each element of the array will have a
newline on the end. Maybe this is what you want, but I doubt it.
- -Stut
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFEw3tl2WdB7L+YMm4RA
's a numeric array, I shouldn't need quotes around the ip octets.
> OK, well I did a debug and this is whats coming out:
>
> Array
> (
>[0] => 127.0.0.1,127.0.0.1,127.0.0.1
> )
PHP doesn't know what separates each element of the array, so you need
to tel
nction" error.
>
> Anyone think of another way to do this in a single SQL statement, or
> some other simple method?
select boroughID, count(*) as thecount from bsp_area group by boroughID
order by thecount desc limit 1
- -Stut
-BEGIN PGP SIGNATURE-
Version: GnuPG
or in cookies they should all be
subjected to the same validation. Trust nothing.
-Stut
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
sibility that someone who couldn't
figure that out is writing PHP code scares me. You might want to think
about Googling for an absolute beginners guide to programming before
continuing.
- -Stut
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Usi
, AIM, or MSN.
http://www.theufl.com/ufl_project.htm
Your help would be greatly appreciated.
I would be using phpmyadim for this.
Sure. How much do you pay?
-Stut
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Micah Stevens wrote:
Stut wrote:
Bastien Koert wrote:
Not commenting on the appropriateness or security of the eval
function. Merely offering a possible path. It is up to the OP to
decide if that solution is the correct one.
I would accept that if you'd mentioned, or at least hinted a
essed when using eval. You didn't so I thought it
needed to be pointed out. I think we, as a community, have a
responsibility to point out the potential security and stability
pitfalls of the possible solutions we provide. But that's just me.
-Stut
--
PHP Database Mailing List (htt
're doing (and there
almost always is), do that instead. In this case a description of the
form would be a better thing to store in the DB rather than the code to
generate it.
-Stut
[1] Rasmus, a while back, can't recall when, but it stuck in my mind
Bastien
From: "Ba
suad wrote:
This is for reading a file:
How can I get in PHP the number of files in the directory (rasmus)
and the files names in a loop?
http://php.net/glob or http://php.net/readdir
-Stut
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net
($num = 1; $num <= 3; $num++)
{
$varname = 'suggested_category_'.$num;
$val = $$varname;
// Stick your code here replacing references to the
$suggested_category_1 var with $val
}
Incidentally, I do hope that code was simplified for brevity. There
should be extensive use of
Bevan Christians wrote:
Is there any to query a mysql table to get it to return the field
names that it currently
has marked as Fulltext Indexes?
|SHOW COLUMNS FROM sometable
-Stut
|
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
rest of that page.
-Stut
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
other API (C, Python, Ruby,
*anything*) to MySQL that is consistently easier to setup and use
Again, we'll have to agree to disagree. For me PHP makes setting up and
using MySQL a breeze.
Anyway, I think we should end this here since we're clearly not making a
dent in each others opinion of PHP. Feel free to reply to me offlist if
you really want to continue, but I don't think there would be much point.
-Stut
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
JupiterHost.Net wrote:
Stut wrote:
What planet are you on? Seriously? Because PEAR does not need to be
compiled into PHP. Zend Optimizer is no different to the optimizers
I was referring to --with-pear, sorry "compiled" was not the right
word *
I'm not familiar with the
in
the spirit it is meant, but please answer me this. What has PHP done to
you? Why are you so anti-PHP? And specifically why are you on a PHP list
suggesting people use a different technology?
-Stut
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
stopping you installing any of the PEAR classes
as a regular user and using it yourself. What could be easier? Not
having to read your ignorant emails.
-Stut
--
If ignorance is bliss, you must be in heaven!
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
favour and unsubscribe from this list, or at the very least please stop
posting pointless and time-wasting answers.
-Stut
--
If ignorance is bliss, you must be in heaven!
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
://php.net/mysql. Google tends to be
very good too: http://www.google.co.uk/search?q=php+access+database
-Stut
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
xperienced programmers say
things like Stut has said below because they tend to intimiate
inexperienced coders, make them shy away from asking questions out of
fear that gurus like Stut will say the kinds of things he has said below.
For this reason I'm going to unsubscribe from the list, lest I
tions here!
-Stut
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
ss of others." -- Jules Renard
Say no more!
-Stut
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
nstead of single - that's what real_escape_string was designed to
escape. Alternatively use str_replace to escape single quotes.
-Stut
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
ity as the later it should would
for my purposes.
Just to clarify, my suggestion was mysql_real_escape_string, not
mysqli_real_escape_string. The former is available on PHP4 >= 4.3.0 and
PHP5. That's the function the link I posted goes to
(http://php.net/mysql_real_escape_string).
-Stu
ks fine all the time, but on
the production server I'm running PHP 4.3.11 and MySQL 4.1.12 that's where
i'm having problems with the apostrophe.
RTFM: http://php.net/mysql_real_escape_string and
http://php.net/magic_quotes
-Stut
--
PHP Database Mailing List (http://www.php.net
Trying
Should be...
1 Trying
> > Prob 2: Before the above error started, The
> > following
> > section was not creating 10 rows.
> >
> >
> > > for ($i=0; $i <$count; $i++): ?>
The should
of the file?
I do this on one of my sites using a utility called pstotext. Find it
at http://research.compaq.com/SRC/virtualpaper/pstotext.html
--
Stut
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
67 matches
Mail list logo