Re: [PHP] PHP + SQL..

2007-02-23 Thread Richard Lynch
On Thu, February 22, 2007 7:53 pm, Liz Kim wrote:
> When I try to get a really long string and print it out on a website,
> it
> tends to stop in the middle of the string.
> Is this some sort of a limitation that I can change?

It's probably a limit on the number of characters that can be stored
in your database datatype.

So it's not getting lost when you display it -- It never got into the
DB in the first place.

You may be able to re-configure your DB to change the limit for TEXT
(which I assume you are using) but there may also be a pre-existing
LONGTEXT which has an even higher limit, or you may need to go for a
BLOB which has an even higher limit (often the limit there is the size
of your hard drive).

Better than all of that, however, is to take a step back and consider
if cramming such a large chunk of data into your database is really
the correct solution.

Unless you are actually doing a DB search, sort, or other SQL
operation on that field, you would be better off storing it in a file
on the hard drive, and leaving the DB operations in the DB, and the
large-file operations in the highly-optimized, more mature, and
customized db solution specifically designed for large file
managements.  (aka, your file system)

It's also possible that your datatypes are correct, but the QUERY size
is limited.  This is unlikely given your description, but it's the
NEXT problem you are going to run into, and is even more tricky to
solve unless you have complete control over your environment
(dedicated servers).

You'll have to do more research about the database you are using --
and further questions in this arena really belong on that database's
mailing list, rather than here, as PHP is almost certainly not
involved, really, in the problem.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP + SQL..

2007-02-22 Thread Robert Cummings
On Thu, 2007-02-22 at 17:53 -0800, Liz Kim wrote:
> I am storing a lot of text into my mssql database.
> Are there any special characters I should watch out for?
> I think so far I've got ' covered.

Skip the guesswork and use an appropriate quoting mechanism for your
database -- that said I'm not aware of an mssql specific quoting
mechanism (and I don't care to find out :) -- so maybe just use
addSlashes().

> Also, when I retrieved the string later on...
> The ' is printed out with a \ in the front. How do I get rid of the \?

Turn off magic quotes.

> When I try to get a really long string and print it out on a website, it
> tends to stop in the middle of the string.
> Is this some sort of a limitation that I can change?

Sounds like your storing the data into a table column that is too short
for the data and so it gets truncated when stored. Then when you
retrieve it you get the truncated text. Increase the column width.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP + SQL..

2007-02-22 Thread Liz Kim

I am storing a lot of text into my mssql database.
Are there any special characters I should watch out for?
I think so far I've got ' covered.

Also, when I retrieved the string later on...
The ' is printed out with a \ in the front. How do I get rid of the \?
When I try to get a really long string and print it out on a website, it
tends to stop in the middle of the string.
Is this some sort of a limitation that I can change?

Thank you!


[PHP] PHP SQL Builder with JOIN support

2006-12-06 Thread Kris Leech
Does anyone know of a PHP class/function(s) which will generate SQL with 
support for JOIN's to other tables.


I have used SQL Query Builder by David Regla Demaree, which is great for 
simple SQL but lacks support for JOIN's.


Many thanks in advance, Kris.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP, SQL, AJAX, JS and populating a SelectBox?

2006-03-19 Thread paulm
oh, just realized smth :) the tutorial is not mine i have used with
success and also posted there but the credit for the tutorial is of:
NickName:   Gast
Member Since:   03/26/2005
Location:   Surrey, England
Website:http://www.nmcmahon.co.uk
he must have the credit for it :)

dave wrote:
> as u wish :)
> 
> tedd wrote:
>>> sry bout that it seems i was logged in :) try this on
>>> "http://www.ajaxfreaks.com/tutorials/6/0.php"; it's called "Making a
>>> Google Suggest-like application"
>>
>> Dave:
>>
>> A most excellent example, but a horrible place to put it. The links are
>> all screwed up and confusing. The pages are not designed well (i.e., way
>> off right for me) and errors on their statistics. Link to your site is
>> broke.
>>
>> But, I was able to salvage your code to produce my own example.
>>
>> http://www.xn--ovg.com/ajax_pop-down
>>
>> This ajax stuff is pretty neat.
>>
>> Would you permit me to post this example elsewhere? I'll provide credit
>> to you.
>>
>> tedd
>>
>>
> 

-- 
Paul Marinas, netadm @ RDS Craiova.
GnuPG Key http://pgp.rdscv.ro

RCS&RDS  Craiova
Tel.: +40351.400.444
Fax : +40351.400.445
http://www.rcs-rds.ro

Privileged/Confidential Information may be contained in this message.
If you are not in the addresses indicated in this message (or
responsible fordelivery of the message to such person), you may not
copy or deliver this message to anyone. In such a case, you should
destroy this message and kindly notify the sender by reply e-mail.



signature.asc
Description: OpenPGP digital signature


Re: [PHP] PHP, SQL, AJAX, JS and populating a SelectBox?

2006-03-19 Thread dave
as u wish :)

tedd wrote:
>> sry bout that it seems i was logged in :) try this on
>> "http://www.ajaxfreaks.com/tutorials/6/0.php"; it's called "Making a
>> Google Suggest-like application"
> 
> 
> Dave:
> 
> A most excellent example, but a horrible place to put it. The links are
> all screwed up and confusing. The pages are not designed well (i.e., way
> off right for me) and errors on their statistics. Link to your site is
> broke.
> 
> But, I was able to salvage your code to produce my own example.
> 
> http://www.xn--ovg.com/ajax_pop-down
> 
> This ajax stuff is pretty neat.
> 
> Would you permit me to post this example elsewhere? I'll provide credit
> to you.
> 
> tedd
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP, SQL, AJAX, JS and populating a SelectBox?

2006-03-19 Thread tedd

sry bout that it seems i was logged in :) try this on
"http://www.ajaxfreaks.com/tutorials/6/0.php"; it's called "Making a
Google Suggest-like application"



Dave:

A most excellent example, but a horrible place to put it. The links 
are all screwed up and confusing. The pages are not designed well 
(i.e., way off right for me) and errors on their statistics. Link to 
your site is broke.


But, I was able to salvage your code to produce my own example.

http://www.xn--ovg.com/ajax_pop-down

This ajax stuff is pretty neat.

Would you permit me to post this example elsewhere? I'll provide credit to you.

tedd


--

http://sperling.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] PHP, SQL, AJAX, JS and populating a SelectBox?

2006-03-18 Thread Chrome
Ajax can be made to use POST by adding

req.open("POST", url, true); // true creates an asynchronous connection
req.setRequestHeader('Content-Type','application/x-www-form-urlencoded');

where req is the XHR object

Also why not use the same style of formatting for the response as the
request uses... eg:

foo=My Foo&bar=My Bar&wibble=My Wibble

The first value is the option value and the second is the option text

FWIW I think that using innerHTML is a bad idea as the elements created
aren't included in the DOM tree... creating the elements using the DOM is a
much better idea... It may be more lengthy by that can be cut down some with
clever scripting :)

HTH

Dan

---
http://chrome.me.uk
 

-Original Message-
From: Daevid Vincent [mailto:[EMAIL PROTECTED] 
Sent: 18 March 2006 22:45
To: php-general@lists.php.net
Cc: 'tedd'
Subject: RE: [PHP] PHP, SQL, AJAX, JS and populating a SelectBox?

No. All of the examples I find are like the 'google' style suggest-thingy.

I want to dynamically (AJAX) populate an actual:


 foo 
 bar
 fee
 fum
 

Basically the core problem is passing back an 'array' of data from mysql
into JS to make the box.

What I've 'hacked' together so far is that I return my values like so from
PHP/mySQL to JS AJAX:

$tmp = "1|foo|2|bar|3|fee|4|fum";

And then in JS, I do this:

tokens = tmp.split('|');

Then use a for(i++2) loop and build up the options (key and value) of the
select box.

But, to me this seems like a hack.

Plus I'm a little worried that there is going to be a size limit of
characters or data or something? After all, AFAIK AJAX uses $_GET method
right? Not $_POST. So I think GET has a limit of like 1024 characters,
whereas POST doesn't have that limit.

My select box could have potentially thousands of items in it. Say for
example, IP addresses. I have supporting select boxes to filter by ranges,
or groups, or whatever, but there's nothing restricting a user from NOT
using them, and just wanting to see ALL the IP addresses...

So, I guess what I'm asking, is, is this the right way to solve this
challenge, or is there a better/more accepted way?

> -Original Message-
> From: tedd [mailto:[EMAIL PROTECTED] 
> Sent: Saturday, March 18, 2006 1:02 PM
> To: php-general@lists.php.net; Daevid Vincent
> Subject: Re: [PHP] PHP, SQL, AJAX, JS and populating a SelectBox?
> 
> >I need to dynamically update a select box
> >with results from a SQL database using AJAX,
> >but I can't find a single example of how to do this.
> >
> >Basically I have a text input field, and a select box.
> >As someone types in the input field,
> >I want the select box to fill in the results of matches.
> >
> >I can fill in a  (as per the ten million examples out there)
> >and that's all fine and dandy, but way too simplistic for 
> what I need.
> 
> Select Box?
> 
> Do you mean a Selection List, that will change as the user types in 
> an input field like this:
> 
> http://www.itsyourdomain.com/
> 
> Just type domain name into the search box -- is that what 
> you're looking for?
> 
> tedd
> -- 
> --
> --
> http://sperling.com
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


__ NOD32 1.1450 (20060318) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] PHP, SQL, AJAX, JS and populating a SelectBox?

2006-03-18 Thread tedd

No. All of the examples I find are like the 'google' style suggest-thingy.

I want to dynamically (AJAX) populate an actual:


 foo
 bar
 fee
 fum


Basically the core problem is passing back an 'array' of data from mysql
into JS to make the box.

What I've 'hacked' together so far is that I return my values like so from
PHP/mySQL to JS AJAX:

$tmp = "1|foo|2|bar|3|fee|4|fum";

And then in JS, I do this:

tokens = tmp.split('|');

Then use a for(i++2) loop and build up the options (key and value) of the
select box.

But, to me this seems like a hack.

Plus I'm a little worried that there is going to be a size limit of
characters or data or something? After all, AFAIK AJAX uses $_GET method
right? Not $_POST. So I think GET has a limit of like 1024 characters,
whereas POST doesn't have that limit.

My select box could have potentially thousands of items in it. Say for
example, IP addresses. I have supporting select boxes to filter by ranges,
or groups, or whatever, but there's nothing restricting a user from NOT
using them, and just wanting to see ALL the IP addresses...

So, I guess what I'm asking, is, is this the right way to solve this
challenge, or is there a better/more accepted way?


A better acceptable way? I'm clueless as to what is better. Ajax is 
too new to me to make a determination as to what is the best or 
acceptable way.


I just know that ajax can be used to replace the contents between 
specific tags in an html document without having to reload the entire 
page. So, I don't see any reason why you can't replace stuff between 
 tags with stuff you pull out from mysql.


As far as the limit, your assumption is not correct. I just tried a 
test of over 14,000 characters with no problem at all, see:


http://www.xn--ovg.com/ajax1  Click First page

So, you shouldn't have any problem populating a select box with 
thousands of characters -- although you may want to LIMIT that in 
your mysql and pull it out in shorter segments.


tedd

--

http://sperling.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] PHP, SQL, AJAX, JS and populating a SelectBox?

2006-03-18 Thread Daevid Vincent
No. All of the examples I find are like the 'google' style suggest-thingy.

I want to dynamically (AJAX) populate an actual:


 foo 
 bar
 fee
 fum
 

Basically the core problem is passing back an 'array' of data from mysql
into JS to make the box.

What I've 'hacked' together so far is that I return my values like so from
PHP/mySQL to JS AJAX:

$tmp = "1|foo|2|bar|3|fee|4|fum";

And then in JS, I do this:

tokens = tmp.split('|');

Then use a for(i++2) loop and build up the options (key and value) of the
select box.

But, to me this seems like a hack.

Plus I'm a little worried that there is going to be a size limit of
characters or data or something? After all, AFAIK AJAX uses $_GET method
right? Not $_POST. So I think GET has a limit of like 1024 characters,
whereas POST doesn't have that limit.

My select box could have potentially thousands of items in it. Say for
example, IP addresses. I have supporting select boxes to filter by ranges,
or groups, or whatever, but there's nothing restricting a user from NOT
using them, and just wanting to see ALL the IP addresses...

So, I guess what I'm asking, is, is this the right way to solve this
challenge, or is there a better/more accepted way?

> -Original Message-
> From: tedd [mailto:[EMAIL PROTECTED] 
> Sent: Saturday, March 18, 2006 1:02 PM
> To: php-general@lists.php.net; Daevid Vincent
> Subject: Re: [PHP] PHP, SQL, AJAX, JS and populating a SelectBox?
> 
> >I need to dynamically update a select box
> >with results from a SQL database using AJAX,
> >but I can't find a single example of how to do this.
> >
> >Basically I have a text input field, and a select box.
> >As someone types in the input field,
> >I want the select box to fill in the results of matches.
> >
> >I can fill in a  (as per the ten million examples out there)
> >and that's all fine and dandy, but way too simplistic for 
> what I need.
> 
> Select Box?
> 
> Do you mean a Selection List, that will change as the user types in 
> an input field like this:
> 
> http://www.itsyourdomain.com/
> 
> Just type domain name into the search box -- is that what 
> you're looking for?
> 
> tedd
> -- 
> --
> --
> http://sperling.com
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP, SQL, AJAX, JS and populating a SelectBox?

2006-03-18 Thread tedd

I need to dynamically update a select box
with results from a SQL database using AJAX,
but I can't find a single example of how to do this.

Basically I have a text input field, and a select box.
As someone types in the input field,
I want the select box to fill in the results of matches.

I can fill in a  (as per the ten million examples out there)
and that's all fine and dandy, but way too simplistic for what I need.


Select Box?

Do you mean a Selection List, that will change as the user types in 
an input field like this:


http://www.itsyourdomain.com/

Just type domain name into the search box -- is that what you're looking for?

tedd
--

http://sperling.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP, SQL, AJAX, JS and populating a SelectBox?

2006-03-18 Thread dave
hi, i used
http://www.ajaxfreaks.com/tutorials/6/3.php?topic_id=73&hl=104#104
it works just fine, i implemented to one of my web, so far so good. Hope
it's what u are looking for

Daevid Vincent wrote:
> I need to dynamically update a select box 
> with results from a SQL database using AJAX, 
> but I can't find a single example of how to do this.
> 
> Basically I have a text input field, and a select box. 
> As someone types in the input field, 
> I want the select box to fill in the results of matches.
> 
> I can fill in a  (as per the ten million examples out there)
> and that's all fine and dandy, but way too simplistic for what I need.
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] PHP, SQL, AJAX, JS and populating a SelectBox?

2006-03-18 Thread Weber Sites LTD
Why invent the wheel?

http://developer.ebusiness-apps.com/technologies/webdevelopment/codeandcompo
nents/ebawebcombov3/default.htm

Sincerely 
 
berber 
 
Visit the Weber Sites Today, 
To see where PHP might take you tomorrow. 
PHP code examples : http://www.weberdev.com 
PHP & MySQL Forums : http://www.weberforums.com
Free Uptime Monitor : http://uptime.weberdev.com
SEO Data Monitor http://seo.weberdev.com
 

-Original Message-
From: Daevid Vincent [mailto:[EMAIL PROTECTED] 
Sent: Saturday, March 18, 2006 4:43 AM
To: php-general@lists.php.net
Subject: [PHP] PHP, SQL, AJAX, JS and populating a SelectBox?

I need to dynamically update a select box with results from a SQL database
using AJAX, but I can't find a single example of how to do this.

Basically I have a text input field, and a select box. 
As someone types in the input field,
I want the select box to fill in the results of matches.

I can fill in a  (as per the ten million examples out there) and that's
all fine and dandy, but way too simplistic for what I need.

--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP, SQL, AJAX, JS and populating a SelectBox?

2006-03-17 Thread Daevid Vincent
I need to dynamically update a select box 
with results from a SQL database using AJAX, 
but I can't find a single example of how to do this.

Basically I have a text input field, and a select box. 
As someone types in the input field, 
I want the select box to fill in the results of matches.

I can fill in a  (as per the ten million examples out there)
and that's all fine and dandy, but way too simplistic for what I need.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] PHP SQL Code

2003-03-02 Thread John W. Holmes
> > > I would like yo show the users in a list that have a date that is
more
> > > than
> > > 60 days old.
> >
> > $sql = "SELECT * FROM stompers WHERE sUpdated < CUR_DATE() -
INTERVAL 60
> > DAY AND sActive = 'Y' ORDER BY sUpdated DESC";
>
> This one returns a 'Could not get Query' warning ... so thats out.

Sorry, it's CURDATE(), not CUR_DATE(). Maybe you shouldn't be so quick
to rule things out...

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP SQL Code

2003-03-02 Thread Philip J. Newman
This one returns a 'Could not get Query' warning ... so thats out.


- Original Message -
From: "John W. Holmes" <[EMAIL PROTECTED]>
To: "'Philip J. Newman'" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Monday, March 03, 2003 5:31 AM
Subject: RE: [PHP] PHP SQL Code


> > I would like yo show the users in a list that have a date that is more
> > than
> > 60 days old.
>
> $sql = "SELECT * FROM stompers WHERE sUpdated < CUR_DATE() - INTERVAL 60
> DAY AND sActive = 'Y' ORDER BY sUpdated DESC";
>
> ---John W. Holmes...
>
> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> today. http://www.phparch.com/
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] PHP SQL Code

2003-03-02 Thread John W. Holmes
> I would like yo show the users in a list that have a date that is more
> than
> 60 days old.

$sql = "SELECT * FROM stompers WHERE sUpdated < CUR_DATE() - INTERVAL 60
DAY AND sActive = 'Y' ORDER BY sUpdated DESC";

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP SQL Code

2003-03-02 Thread Tim Ward
I'd use ...
WHERE UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(sUpdated) > 60*60*24*60

but I'm sure someone will come up with something more efficient.

Tim Ward
http://www.chessish.com
mailto:[EMAIL PROTECTED]
- Original Message -
From: Philip J. Newman <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, March 02, 2003 7:46 AM
Subject: [PHP] PHP SQL Code


> I would like yo show the users in a list that have a date that is more
than
> 60 days old.
>
>
> $sql = "SELECT * FROM stompers WHERE sUpdated <
> from_unixtime(unix_timestamp(now())-(15760*60)) AND sActive = 'Y' ORDER BY
> sUpdated DESC";
>
> This don't quite work ..
>
> Any suggestions?
>
>
> --
> Philip J. Newman.
> Head Developer
> [EMAIL PROTECTED]
>
> +64 (9) 576 9491
> +64 021-048-3999
>
> --
> Friends are like stars
> You can't allways see them,
> but they are always there.
>
> --
> Websites:
>
> PhilipNZ.com - Design.
> http://www.philipnz.com/
> [EMAIL PROTECTED]
>
> Philip's Domain // Internet Project.
> http://www.philipsdomain.com/
> [EMAIL PROTECTED]
>
> Vital Kiwi / NEWMAN.NET.NZ.
> http://www.newman.net.nz/
> [EMAIL PROTECTED]
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP SQL Code

2003-03-01 Thread Philip J. Newman
I would like yo show the users in a list that have a date that is more than
60 days old.


$sql = "SELECT * FROM stompers WHERE sUpdated <
from_unixtime(unix_timestamp(now())-(15760*60)) AND sActive = 'Y' ORDER BY
sUpdated DESC";

This don't quite work ..

Any suggestions?


--
Philip J. Newman.
Head Developer
[EMAIL PROTECTED]

+64 (9) 576 9491
+64 021-048-3999

--
Friends are like stars
You can't allways see them,
but they are always there.

--
Websites:

PhilipNZ.com - Design.
http://www.philipnz.com/
[EMAIL PROTECTED]

Philip's Domain // Internet Project.
http://www.philipsdomain.com/
[EMAIL PROTECTED]

Vital Kiwi / NEWMAN.NET.NZ.
http://www.newman.net.nz/
[EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP/SQL - inserting into database null results

2002-08-21 Thread Tom Rogers

Hi,

Wednesday, August 21, 2002, 11:25:30 PM, you wrote:
n> I am a new person to PHP.  I have purchased and read PHP fast & easy by
n> Julie Meloni and have also read the 24 hours PHP book.  I am able to connect
n> to the SQL database and insert into the database via my html form.  However,
n> the values are null.  When I look at the data in my database, it reads " ",
n> " ", " ", etc.

n> I have tried a couple different code:

n> $query = "INSERT INTO MemberReviews
n>  VALUES (' ','$memb_name', '$bookname','$author', '$grade', '$review') ";
n> mysql_query($query);

n> mysql_close();

n> or in the form itself, I have tried:

n>  # this is processed when the form is submitted
n> # back on to this page (POST METHOD)
n> if ($REQUEST_METHOD=="POST") {

n> # double-up apostrophes
n> $review = str_replace("'","''",$review);
n> $author = str_replace("'","''",$author);

n> # setup SQL statement
n> $SQL = " INSERT INTO MemberReviews ";
n> $SQL = $SQL . " (memb_name, bookname, author, grade, review) VALUES
n> ";
n> $SQL = $SQL . " ('$memb_name', '$bookname','$author', '$grade',
n> '$review') ";

n> #execute SQL statement
n> $result = mysql_db_query($db,"$SQL",$cid);

n> # check for error
n> if (!$result) { echo("ERROR: " . mysql_error() . "\n$SQL\n");}

n> echo ("New Record Added\n");

n> }

?>>

n> Thanks in advance for your help

n> Jennifer

If you have the latest version of php (4.2.2 or 4.2.1) try

if(!empty($_POST['memb_name']))$memb_name = add_slashes($_POST['memb_name']);
if(!empty($_POST['bookname']))$bookname = add_slashes($_POST['bookname']);

and so on, then add them to your query string.
(add_slashes() will take care of any pesky quotes)

-- 
regards,
Tom


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] PHP/SQL - inserting into database null results

2002-08-21 Thread news

I am a new person to PHP.  I have purchased and read PHP fast & easy by
Julie Meloni and have also read the 24 hours PHP book.  I am able to connect
to the SQL database and insert into the database via my html form.  However,
the values are null.  When I look at the data in my database, it reads " ",
" ", " ", etc.

I have tried a couple different code:

$query = "INSERT INTO MemberReviews
 VALUES (' ','$memb_name', '$bookname','$author', '$grade', '$review') ";
mysql_query($query);

mysql_close();

or in the form itself, I have tried:

New Record Added\n");

}

?>

Thanks in advance for your help

Jennifer




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] PHP/SQL programmer position open Portland OR/Vancouver WA area.

2002-04-04 Thread Eric JT Harlow

Group,

My consulting company has a fulltime open position located in Vancouver
WA.  We are a fast-moving/flexible/customer driven company looking for
the same in our new PHP/SQL programmer.  If interested please send your
resume and salary history to: [EMAIL PROTECTED]


Thank you for your time,

Eric JT Harlow
Sisgrate Technologies
www.sisgrate.com
Email: [EMAIL PROTECTED]
Phone: 360 891 6991
Fax: 360 891 6865

“This communication (including attachments) contains private,
confidential, privileged and/or proprietary information intended solely
for the Recipient (s) named above. If you are not the intended
Recipient, any use, dissemination, distribution or copying of the
communication is strictly prohibited. If received in error, we apologize
and ask that you please notify the Sender by calling (360) 891 6991 or
via return e-mail, permanently delete this communication from your
computer and destroy any printed copies. Thank you in advance for your
cooperation.”


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] PHP, SQL and all that stuff...

2002-02-11 Thread Liam MacKenzie

Ok guys,
I've been pondering over setting up a free PHP/SQL
hosting service for some time now, but never really
actually done it.

It looks like just the mention of it got some seriously
positive feedback, so I'm keen to actually do it
properly.  But...

I need some help with security.  With a bit of luck
you'll all understand where i'm coming from.  This
is my personal system too, and I don't particularly
wish for someone "test script" to go awfully wrong
and wipe my entire webserver!
That would put me out of business for quite a while!

If there's anyone out there who's good with this
kind of thing, PLEASE email me because I'd love
to get this hosting system going!

I'd also like to provide shell access, but at the moment
that is way way way out of the question.  I'm
not the most experianced person in Linux, and
handing out Shell access at the moment is not wise.

But with your help, I can provide you all with these 
services, free of charge and advertising!

If you're willing to help, please email me!

Thank you!
- Lum



[PHP] PHP/SQL login problems

2002-01-07 Thread Jeremy Reed

I am having problems connecting and pulling data from a local SQL server.  I
have set up a user and, as far as I can tell, all the settings for the user
are correct.  However, when I try to pull data using the user, I get empty
result sets--almost as if I don't have SELECT permissions.  When I log in
via Query Analyzer with the same login/pass, I am able to pull the data with
no problems.  Also, when I use the same code but log into an offsite
database, the code works fine (except for the lag of pulling large amounts
of data--which is what I'm trying to avoid)

The only thing I can figure that might be affecting it is the ownership.
The owner of the DB is 'dbo'--because this is a straight copy of a database
on an offsite server.

Any help would be greatly appreciated.

Best regards,

Jeremy Reed



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] php/sql code gives blank page

2001-08-03 Thread sono

I created a little php script to run and display stuff on my browser for
printing.
When I run the command I get a blank page though.
I tested the syntax of my command in mysql and on phpMyAdmin to make sure
it worked.

Here is the code:
---
= 2001070900 AND timestamp < 2001080300";

$result = mysql_query($query) or die("Query Failed");

print ("Query executed and returned"); <-THIS DISPLAYS

while($row == mysql_fetch_array($result)) {

$timestamp = $row["timestamp"];
$msg_id = $row["msg_id"];
$msg = $row["msg"];
echo"   
Time: $timestamp
Pager Number: $msg_id
Message: $msg";
}
?>

---
Is there something specific in this code that would cause the page to
display blank?  (Blank except for the print statements at the top that
tell me whether it connected or not)

I do notice the page take awhile to load(the blank page)...it almost looks
like it is timing out maybe?

Thanks IN advance:)
Cheers
Sono







-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]