Re: [PHP-DB] problem in connecting to mysql from php

2011-06-14 Thread Abah Joseph
create a file with phpinfo() and make sure mysqli is listed in the loaded
modules

On Tue, Jun 14, 2011 at 12:07 PM, Niel Archer n...@chance.now wrote:


  Hello everyone,
 
  I am in the process of learning php and I was trying to connect to a
 mysql
  database on my own computer(localhost). I have done the following as
  prerequisites:
 
  copied the dll files in system32
  removed the semicolon(;) from extension=php_mysqli.dll

 You should NOT need to move the .dll at all. There is a
 setting in the ini which tells PHP where to look for extensions and that
 should have pointed to the original location. Hence, removing the
 semicolon should be the only part necessary.

  In spite of doing the above when I try to run the following :
 
  ?php
  $db = new MySQLi('localhost', 'root', 'Password123', 'test');
  $sql = 'SELECT * FROM a123';
  $result = $db-query($sql);
 
  while($row = $result-fetch_object()) {
  echo 'div' . $row-name . '/div';
  }
 
  $db-close();
  ?
 
  I get the error: *Fatal error*: Class 'MySQLi' not found in *C:\Program
  Files\Apache Software Foundation\Apache2.2\htdocs\a.php* on line *2
 
  *Please guide me as to how can I get rid of this error?
 
  Regards,
  Kushal



 --
 Niel Archer
 niel.archer (at) blueyonder.co.uk


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




-- 
*Share with free mind!*
Join I.T professionals on http://www.tuwana.com
For Web development and design http://abahjoseph.com
Follow me on Twitter http://twitter.com/freefazee
Mobile: *+2348066100671*


[PHP-DB] Module positioning

2010-09-06 Thread Abah Joseph
Sorry if i`m posting on the wrong list.

 i have used joomla and prestashop open source application and enjoy
the way modules are position, prestashop uses HOOK to position modules
inside the template while in joomla you define position name and place
the module inside the position, in my own case, i just need the theory
behind it. i can code it but i need the theory or some idea where to
start from.

i`m planning to use smarty as my template engine.

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



[PHP-DB] Role Based Access Control and Role Based Security

2010-01-25 Thread Abah Joseph
Hi list, thank to the wonderful people on this list.

I am planning a system that require access to the system based on
Role, i love the implementation in SMF(www.simplemachines.org) that
every modules can define there own role and but i don`t know how.

Users will be in group like Administrator, Editor, Manager etc (i have
seen such on Joomla) and each module can define the action each group
can perform e.g
An advertisement module will define something like 'Can add', 'Can
edit own', 'can edit any',  etc.. i am wondering what the database
structure/PHP Class will look like.

I found a database Schema on Access Control at
http://www.databaseanswers.org/data_models/access_control/index.htm
but i can`t figure out the implementation in PHP.
Any idea will help.

-- 
Share with free mind!
Join the world largest open forum for hackers and programmers.
http://www.tuwana.com

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



[PHP-DB] Authenticating user using a web service

2009-01-23 Thread Abah Joseph
Well, I have asked this question before but it seems people don`t understood
me, my intension is to have a second login option like, user may choose to
login with they facebook/myspace/etc id or the local id (my site) on my
site, I want a situation whereby anyone can choose to register or use
an existing social network id and password to login, so I am thinking of
using facebook, but i don`t really understand something about facebook
application, the application always, first go to facebook then redirect back
to the site (callback url), I want all this process done under the hood.

Can someone give me another idea? I will just love any simple idea that will
help.


[PHP-DB] Help with Web services (facebook, myspace)

2009-01-21 Thread Abah Joseph
Hello PHP people,
I`m looking for facebook and myspace API that will enable user to login on
my site using their facebook and myspace id. if this is not possible, can i
find something closer like, user will be able to perform
some activities from my site like inviting facebook/myspace friends, send
IVs etc.

Please very new in this.

Thank you


Re: [PHP-DB] Help with Web services (facebook, myspace)

2009-01-21 Thread Abah Joseph
I just saw something on pear.net
http://pear.php.net/package/Services_Facebookmaybe it will work.


On Wed, Jan 21, 2009 at 10:27 PM, Chris dmag...@gmail.com wrote:

 Abah Joseph wrote:

 Hello PHP people,
 I`m looking for facebook and myspace API that will enable user to login on
 my site using their facebook and myspace id. if this is not possible, can
 i
 find something closer like, user will be able to perform
 some activities from my site like inviting facebook/myspace friends, send
 IVs etc.


 http://developers.facebook.com/?ref=pf

 I don't know if myspace has a developer area but ask in their forum:

 http://forums.myspace.com/?fuseaction=forums.home

 --
 Postgresql  php tutorials
 http://www.designmagick.com/




-- 
I develop dynamic website with PHP  MySql, Let me know about your site


[PHP-DB] help me JOIN 3 tables.

2009-01-13 Thread Abah Joseph
I have this SQL

SELECT e1.*, l1.* FROM e1
INNER JOIN l1 WHERE e1.entre_active = 'Y' AND l1.entreID = e1.entre_id

The above query works but i want to add the one below

SELECT SUM(a1.adp_amount) as amount FROM a1 WHERE a1.adp_loanID = e1.loanID;

the last part of the query is to SUM the part payment made on table 'l1' and
return total raised with the first query.

the whole idea is three tables, (business, loan, raised), loan referenced ID
from business, raised referenced ID from loan.

loan maybe $300 and it can be raised over time till completed, so all the
amount raised + the loanId will be stored inside the raised table.

Thank you


[PHP-DB] Post/Read tutorial at Tuwana.com

2008-12-05 Thread Abah Joseph
Post your article/tutorial on www.tuwana.com, is a new forum that brings
together world programmers and hackers.


[PHP-DB] Can MySql handle Large data?

2008-11-17 Thread Abah Joseph
I want to quickly ask if MySql can handle large data like 10 – 20 million
rows in one database (e.g member table)

The question came to my mind is, How did large website like Yahoo handle
such data? Sure. Yahoo users may be more than 20 millions users or so.


Users will have -permission table
  -profile table
  -page table  and so on, so query will be perform on 2
or three tables same time, i`m trying to check the speed, performance and
risk .

I need your advice on how to handle such data and the best structure to use.


[PHP-DB] Win32 system administrator gpedit.msc

2008-10-10 Thread Abah Joseph
Hi everybody... i`m not a prof in english so please read and understand me..
Thank u.

Using the win32 python module can we perform every tasks like *gpedit.msc?*
i will like to automate tasks like enabling or disaple some of the windows
functions. with my basic experince, you can perform important adminsitrative
tasks using gpedit.msc. Like today, some virus hidded my start menu/program
file and i have to use gpedit.msc to enable it. point me to some article
that talk about this.


Re: [PHP-DB] how is this line a security risk?

2008-09-23 Thread Joseph Crawford

read up on register_globals.  It is a security risk because if i do
http://domain.com/file.php?plugins_directory=/directory/

it can reset your variable.

the best way to do that is to make PLUGINS_DIR a constant

define('PLUGINS_DIR', '/directory/');

Joseph Crawford

On Sep 23, 2008, at 12:58 PM, michael wrote:

I get an error stating that this line in my code is a security risk  
when I code it.


require_once($PLUGINS_DIRECTORY.forum/forum.php);

here is what the explanation is:

include() or analogous is used with variable argument this can be  
dangerous since variables are in many cases controlled by remote  
users.


the recommended  soloution is to write it this way

define('SCRIPT_PATH',/htdocs);
include ('sSCRIPT_PATH./Foo.inc);

my question is why is the other way safer? im kinda confused..



--
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 unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Matrix programming

2008-09-23 Thread A. Joseph
I need to do some stuff on MLM system so i will be using matrix caculation,
i need a tutorial on it.




On 9/23/08, Micah Gersten [EMAIL PROTECTED] wrote:

 Only is register_globals is on can that reset a variable.  You are
 correct though, defining directory paths is safer.

 Thank you,
 Micah Gersten
 onShore Networks
 Internal Developer
 http://www.onshore.com



 Joseph Crawford wrote:
  read up on register_globals.  It is a security risk because if i do
  http://domain.com/file.php?plugins_directory=/directory/
 
  it can reset your variable.
 
  the best way to do that is to make PLUGINS_DIR a constant
 
  define('PLUGINS_DIR', '/directory/');
 
  Joseph Crawford
 
  On Sep 23, 2008, at 12:58 PM, michael wrote:
 
  I get an error stating that this line in my code is a security risk
  when I code it.
 
  require_once($PLUGINS_DIRECTORY.forum/forum.php);
 
  here is what the explanation is:
 
  include() or analogous is used with variable argument this can be
  dangerous since variables are in many cases controlled by remote users.
 
  the recommended  soloution is to write it this way
 
  define('SCRIPT_PATH',/htdocs);
  include ('sSCRIPT_PATH./Foo.inc);
 
  my question is why is the other way safer? im kinda confused..
 
 
 
  --
  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 unsubscribe, visit: http://www.php.net/unsub.php




-- 
I develop dynamic website with PHP  MySql, Let me know about your site


Re: [PHP-DB] Im new to this but...

2008-09-02 Thread Joseph Crawford
You did everything perfectly in the email except for show what the  
error message was.


i am assuming your issue is with the line

$page = '$_GET[page]';

that should just be

$page = $_GET['page'];

The way you are doing it (inside single quotes) does not evaluate the  
array as a variable, rather PHP thinks the entire thing is just a  
string.


when you you do the query

$sql = SELECT * FROM page WHERE id=$page;

Your query is actually

SELECT * FROM page WHERE id=$_GET[page];

Now changing that one line may fix the issue at hand but I will also  
suggest that you read articles, blog entries, etc about SQL Injection  
and how to cleanse your data before throwing a user submitted value at  
your database.


Thanks,
Joseph Crawford

On Sep 2, 2008, at 3:05 PM, Chris Hale wrote:


I have:
Apache 2.0.59
MySQL 5.0.41
PHP 4.4.7  5.2.5

and this is my program:

?php
session_start();
include(includes/functions_main.php);
include(Vars.php);
?   ?php get_header(); ?
?php get_sidebar(); ?
?php
  $page = '$_GET[page]';
  $cxn = mysqli_connect($host, $user,$passwd, $database) or die  
(Can't Connect.);

  $sql = SELECT * FROM page WHERE id=$page;
  $result = mysqli_query($cxn, $sql);
  $row = mysqli_fetch_assoc($result);
  extract ($row);
?
div id=column_right
  div class=content
  h2?php $title ?/h2
  ?php $content ?
  /div
/div
?php get_footer();?


But i get an error every time. I have read PHP and MySQL for Dummies  
to get me started but none of the things in the book seem to work  
for me. It is very frustrated. I dont know whether it just my  
lameass host provider that hasn't set the mysql properly.


I would appreciate any help.

Thanks

--
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 unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Random content from MySql DB

2008-08-26 Thread A. Joseph
I`m creating a small application that let users take test online, the
user will login and visit the test page, questions and answers are
stored in MySql database,

i want to display each randomly without repeating.

test must to completed between some specific amount of time or else
the application will forcefully submit the form and calculated the
completed ones (Eac question come up at a time and you choose the
answer and submit, then another come show up again, just like that),

I have plan of saving user`s progress and user may continue next time
if he/she has not spent the total test time.

I need your help on how to random the questions without repeating any
and if a user may need to continue from he/her past, the random should
also exclude the past questions stored inside the user progress table.

What is your best advice, i want to start creating the mysql table soon.

Thank you

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



[PHP-DB] Multi-level marketing system

2008-08-14 Thread A. Joseph
I want to develop a multilevel marketing system, please can someone give me
a good starting point,  or if you know a system developed for such, tell me.



It will be a hierarchical structure.

But members will need to earn money on some level



Thank U.


[PHP-DB] I want to remove the last comma

2008-08-12 Thread A. Joseph
This the script
$dir = images;
$d = opendir($dir);
$out = 
var tinyMCEImageList = new Array(\n;
while(false != ($entry = readdir($d))) {
if(preg_match(/(.jpg|.gif|.png)$/, $entry) != false) {
$out .= ['{$entry}', '{$dir}/{$entry}'],\n;
}

}
$out .= );\n;

This the out put

var tinyMCEImageList = new Array(
['1_h_1.gif', 'images/1_h_1.gif'],
['1_h_2.gif', 'images/1_h_2.gif'],
['rss_2.jpg', 'images/rss_2.jpg'],
['spacer.gif', 'images/spacer.gif'],  #  I want to remove this comma
);

if the last element (['spacer.gif', 'images/spacer.gif'],) contain comma,
javascript will return error, so i want to remove it.


[PHP-DB] Recommended web developers

2008-06-24 Thread A. Joseph
Which company in India or USA can you recommend to design a complex
website for my company.

The site will be a social site, will include, Blog, Articles, Shops,
Music, Movie, Directory, Pre-paid card system, Culture and Tourism,
downloads, file upload and sharing
The site is just like yahoo, but no email service.

Advert method will be like Google Ads
PHP 5 MySql, Smarty, SOAP Service, Ajax, Javascript, div based, Apache
with mod_rewrite

Admin Area, Users area, front end
Full detail will be available
Planned amount is  $1 Max

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



Re: [PHP-DB] Recommended web developers

2008-06-24 Thread A. Joseph
Well, I can also write a good working PHP code but this project did
more professionals, like security issues, but the main part of the
project is, Dating, The Shop and Music/Movie, The Pre-paid card system
and the user financial account,  each user can credit his/her account
with the card and user his/her account to purchase from the site. so i
want the the site (The pre-paid card system) model in such a way that
other site can also accept it, (Mybe using SOAP server/client).

So for the shop, each user can create his/her shop, create
categories/sub categories, add product and more.., so payment will be
based on the user account.

For the others, i think Joomla has something cool, like the way
articles are arranged into section = category and more..

Send me direct email and not on the list please

On 6/24/08, Bastien Koert [EMAIL PROTECTED] wrote:
 On Tue, Jun 24, 2008 at 11:00 AM, A. Joseph [EMAIL PROTECTED] wrote:

 Which company in India or USA can you recommend to design a complex
 website for my company.

 The site will be a social site, will include, Blog, Articles, Shops,
 Music, Movie, Directory, Pre-paid card system, Culture and Tourism,
 downloads, file upload and sharing
 The site is just like yahoo, but no email service.

 Advert method will be like Google Ads
 PHP 5 MySql, Smarty, SOAP Service, Ajax, Javascript, div based, Apache
 with mod_rewrite

 Admin Area, Users area, front end
 Full detail will be available
 Planned amount is  $1 Max

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


 I would try and see what you can do with Joomla or Drupal first, before
 custom coding this. Its a lot more work and many items should already be
 available in either of those CMS systems

 --

 Bastien

 Cat, the other other white meat



-- 
I develop dynamic website with PHP  MySql, Let me know about your site

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



Re: [PHP-DB] Recommended web developers

2008-06-24 Thread Joseph Crawford

The cost factor was why I did not speak up myself.

On Jun 24, 2008, at 3:45 PM, Ken Keefe wrote:


I'm a little surprised no one else has commented on this, but for a
website that complicated, 10k is way too low. I've done work on
websites that do almost all of those things separately, but not
combined and I can tell you to have a high quality website that does
just one of the things you mention will cost you about 10k. This is
very much a guess because something like Blogging can be done very
simply (cheaply). But it will not have even close to the feature set
of the major blogging sites.

In fact, I just wrapped up a project that was a simple business
directory last month for 5k. Again, that site was *simple* and no
where near as flexible as the code you see from yahoo or google. There
is a reason those companies pay hundreds of developers 80k a year...

Sorry to rain on your parade. Hopefully you just left out a 0 or  
two...


Ken

On Tue, Jun 24, 2008 at 10:00 AM, A. Joseph [EMAIL PROTECTED]  
wrote:

Which company in India or USA can you recommend to design a complex
website for my company.

The site will be a social site, will include, Blog, Articles, Shops,
Music, Movie, Directory, Pre-paid card system, Culture and Tourism,
downloads, file upload and sharing
The site is just like yahoo, but no email service.

Advert method will be like Google Ads
PHP 5 MySql, Smarty, SOAP Service, Ajax, Javascript, div based,  
Apache

with mod_rewrite

Admin Area, Users area, front end
Full detail will be available
Planned amount is  $1 Max

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






--

Naturally, the common people don't want war, but they can always be
brought to the bidding of the leaders. Tell them they are being
attacked, and denounce the pacifists for lack of patriotism and
endangering the country. It works the same in every country.

--- Herman Goering, Hitler's Reichsmarschall, At the Nuremberg Trials

--
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 unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Re: Array Display

2008-05-07 Thread A. Joseph
The display will look like

  1
  2 2 2 2 2 2 2 2 2
 3 3 3 3 3 3 3 3 3 3 3 3 3
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4

Everybody on level 1 will be on same row
and so on

On 5/7/08, A. Joseph [EMAIL PROTECTED] wrote:
 Please i knew this not the best place to post this message but i ain`t
 gat no option
 i need fast help on this

 I have a Array and data are grouped according to level,
 so want to display everybody on same level in same HTML row
 os if you are on level 0
 then you first,
 to the next people on level one, then level 1 on samle row
 so on..

 Array sample is

 Array
 (
 [0] = Array
 (
 [0] = 1009603
 [section_id] = 1009603
 [1] = 4
 [section_left] = 4
 [2] = 11
 [section_right] = 11
 [3] = 1
 [section_level] = 1
 [4] = Joseph Abah
 [section_name] = Joseph Abah
 )

 [1] = Array
 (
 [0] = 1009956
 [section_id] = 1009956
 [1] = 5
 [section_left] = 5
 [2] = 8
 [section_right] = 8
 [3] = 2
 [section_level] = 2
 [4] = Onuche Mikel
 [section_name] = Onuche Mikel
 )

 [2] = Array
 (
 [0] = 1005539
 [section_id] = 1005539
 [1] = 9
 [section_left] = 9
 [2] = 10
 [section_right] = 10
 [3] = 2
 [section_level] = 2
 [4] = Owen Joncena
 [section_name] = Owen Joncena
 )

 )


 Thank you.



 On 5/6/08, [EMAIL PROTECTED] [EMAIL PROTECTED]
 wrote:
  I am opening a rss file using fopen.
 
  If I use direct value, it can be opened, but I use a paremeter, I
  obtain an error.
 
 
  This works:
 
 ...
 xml_set_character_data_handler($xml_parser, characterData);
 $fp = fopen(http://www.arteglobal.net/news.xml,r;) or die(Error
  reading RSS data.);
 while ($data = fread($fp, 4096))
   {
   xml_parse($xml_parser, $data, feof($fp))
   ...
 
  But this one not (Error reading RSS data):
 
 ...
 $url_rss = http://www.arteglobal.net/news.xml;;
 ...
 xml_set_character_data_handler($xml_parser, characterData);
 $fp = fopen($url_rss,r) or die(Error reading RSS data.);
 while ($data = fread($fp, 4096))
   {
   xml_parse($xml_parser, $data, feof($fp))
   ...
 
 
  Any idea about what is happening?.
 
 
  Thank you!
 
 
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 


 --
 I develop dynamic website with PHP  MySql, Let me know about your site



-- 
I develop dynamic website with PHP  MySql, Let me know about your site

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



[PHP-DB] Array Display

2008-05-06 Thread A. Joseph
Please i knew this not the best place to post this message but i ain`t
gat no option
i need fast help on this

I have a Array and data are grouped according to level,
so want to display everybody on same level in same HTML row
os if you are on level 0
then you first,
to the next people on level one, then level 1 on samle row
so on..

Thank you.



On 5/6/08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 I am opening a rss file using fopen.

 If I use direct value, it can be opened, but I use a paremeter, I
 obtain an error.


 This works:

...
xml_set_character_data_handler($xml_parser, characterData);
$fp = fopen(http://www.arteglobal.net/news.xml,r;) or die(Error
 reading RSS data.);
while ($data = fread($fp, 4096))
  {
  xml_parse($xml_parser, $data, feof($fp))
  ...

 But this one not (Error reading RSS data):

...
$url_rss = http://www.arteglobal.net/news.xml;;
...
xml_set_character_data_handler($xml_parser, characterData);
$fp = fopen($url_rss,r) or die(Error reading RSS data.);
while ($data = fread($fp, 4096))
  {
  xml_parse($xml_parser, $data, feof($fp))
  ...


 Any idea about what is happening?.


 Thank you!



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




-- 
I develop dynamic website with PHP  MySql, Let me know about your site

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



[PHP-DB] Array Display

2008-05-06 Thread A. Joseph
Please i knew this not the best place to post this message but i ain`t
gat no option
i need fast help on this

I have a Array and data are grouped according to level,
so want to display everybody on same level in same HTML row
os if you are on level 0
then you first,
to the next people on level one, then level 1 on samle row
so on..

Array sample is

Array
(
[0] = Array
(
[0] = 1009603
[section_id] = 1009603
[1] = 4
[section_left] = 4
[2] = 11
[section_right] = 11
[3] = 1
[section_level] = 1
[4] = Joseph Abah
[section_name] = Joseph Abah
)

[1] = Array
(
[0] = 1009956
[section_id] = 1009956
[1] = 5
[section_left] = 5
[2] = 8
[section_right] = 8
[3] = 2
[section_level] = 2
[4] = Onuche Mikel
[section_name] = Onuche Mikel
)

[2] = Array
(
[0] = 1005539
[section_id] = 1005539
[1] = 9
[section_left] = 9
[2] = 10
[section_right] = 10
[3] = 2
[section_level] = 2
[4] = Owen Joncena
[section_name] = Owen Joncena
)

)


Thank you.



On 5/6/08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 I am opening a rss file using fopen.

 If I use direct value, it can be opened, but I use a paremeter, I
 obtain an error.


 This works:

...
xml_set_character_data_handler($xml_parser, characterData);
$fp = fopen(http://www.arteglobal.net/news.xml,r;) or die(Error
 reading RSS data.);
while ($data = fread($fp, 4096))
  {
  xml_parse($xml_parser, $data, feof($fp))
  ...

 But this one not (Error reading RSS data):

...
$url_rss = http://www.arteglobal.net/news.xml;;
...
xml_set_character_data_handler($xml_parser, characterData);
$fp = fopen($url_rss,r) or die(Error reading RSS data.);
while ($data = fread($fp, 4096))
  {
  xml_parse($xml_parser, $data, feof($fp))
  ...


 Any idea about what is happening?.


 Thank you!



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




-- 
I develop dynamic website with PHP  MySql, Let me know about your site

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



[PHP-DB] Designing An API with PHP/MySql

2008-04-18 Thread A. Joseph
How can I design a system that let other people modify record from another
server? Like

I have registered member on my site, people can use external application to
check if the

(1) user is registered

(2) user is online

(3) update user profile on mysite



Like the myspace.com stuff, I saw I php class from phpclasses.org that you
can use to modify your profile from another server.

So I want to design something like myspace, but sometime I will want others
to be able to check if a user is registered or online on my system.



I want to use PHP/MySql.

Please I basic example/article link will be appreciated.


[PHP-DB] Generating random numbers

2008-04-16 Thread A. Joseph
What is the best way to generating random numbers and you are sure that the
script will never generate the generated ones?



I`m using mysql database, but this out of SQL AUTO_INCREMENT stuff, I need a
real random generator that will never generate what has been generated.


[PHP-DB] Date calculation from MySql table

2008-04-12 Thread A. Joseph
I want to calculate the registed users today
Also total users this week
Total users this month
Total users this year

The Mysql table has a row of INT(11) with time() value inserted.

I did something like this
$today = strtotime(+1 day)
Then $sql = SELECT COUNT(*) FROM table WHERE dateReg = $today;

Same with year/months also, only I use strtotime(+1 week) for a week,
strtotime(+1 month) for a month,

Can someone help me with this calculation?

On 4/7/08, Bruno Lustosa [EMAIL PROTECTED] wrote:
 On Mon, Apr 7, 2008 at 2:42 PM, Dee Ayy [EMAIL PROTECTED] wrote:
   I was thinking of using output buffering and then making 1 call to
   utf8_encode, but I think a better question is, how do I stop using
   utf8_encode completely?

 If all components are using utf-8, you should have no problems with
 charsets at all. By all components, I mean:
 - Script files in utf-8;
 - Database in utf-8;
 - Database connection using utf-8;
 - Content-type header set to utf-8.
 With all these, you're free of charset hell, and can enjoy the beauty
 of utf-8 completely without problems.

   The rendered view I see in Firefox 2.0.0.12 is a question mark ?
   where the French character should have appeared.  If I use
   utf8_encode, the character appears as it should.

 Question mark means the character is not utf-8. Check where it comes
 from. Might be the database or the way you are connecting to it. I
 don't know much about mysql, I use postgresql. With it, you just have
 to call pg_set_client_encoding() to make the connection in utf-8 mode,
 and create database with encoding='unicode' to set up a database
 using utf-8.

   Luckily I'm on PHP 4.3.10, so I can't see what mb_check_encoding would
   report -- if that would even help normally.

 Shouls upgrade to PHP 5. PHP 4 is way out of date, is not getting
 updates anymore, and will not even get security bugfixes after august
 8th. It's been almost 4 years since PHP 5 was released.

 http://www.php.net/archive/2007.php

 Check the PHP 4 end of life announcement.

 --
 Bruno Lustosa [EMAIL PROTECTED]
 ZCE - Zend Certified Engineer - PHP!
 http://www.lustosa.net/

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




-- 
I develop dynamic website with PHP  MySql, Let me know about your site

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



[PHP-DB] Nestling Array in PHP from MySql

2008-04-09 Thread A. Joseph
Well i need a little ideal on nestling this php array.

This what i want to do.

Have you heard of online clubing? http://www.disneytreasures.biz/

This how it works,

1) (*Agent*) You bring 3 persons (first you as an agent or officer)

2) The 3 person you brought, brings 3 persons each

3) Again each persons under those 3 persons bring 3 persons again, on and on

So, how can i caculate the total persons under you (*the Agent)*

i want to use MySql database, or can you help me with the table structure?

The ideal is like Clubfreedom. and if you see any tutorial on this, please
help me with the link.

Any ideal will be helpful.


[PHP-DB] Re: php-db Digest 9 Apr 2008 13:17:18 -0000 Issue 4019

2008-04-09 Thread A. Joseph
The question is.

Some nestled calculation.
How did club freedom did the calculation, or how will the database structure
looks like?

*The example is -: *

*Joseph* gave birth to *John*, *James,* and *Johnson*
*John* gave birth to* Peter*, *Matter*, and *Potter*
James gave birth to Juliana, Justin, and *Jane*
Johnson gave birth to Jak, Jake and Jacob

Continuously like that,
Peter the son of John also gave birth to another 3 children
And the 3 children also keep giving birth to 3 children each,  so
How can I calculate the Total descendants of Joseph?
How can I calculate the total   descendants of John or any of the grand
children?

Because each of the children also start having grand children, while Joseph
grand descendants increases.

I want to use MySql/PHP
The concept is Like http://www.disneytreasures.biz/ or ClubFreedom

All I want to do is to know who bring who?


[PHP-DB] Re: php-db Digest 9 Apr 2008 13:17:18 -0000 Issue 4019

2008-04-09 Thread A. Joseph
The question is.

Some nestled calculation.
How did club freedom did the calculation, or how will the database structure
looks like?

*The example is -: *

*Joseph* gave birth to *John*, *James,* and *Johnson*
*John* gave birth to* Peter*, *Matter*, and *Potter*
James gave birth to Juliana, Justin, and *Jane*
Johnson gave birth to Jak, Jake and Jacob

Continuously like that,
Peter the son of John also gave birth to another 3 children
And the 3 children also keep giving birth to 3 children each,  so
How can I calculate the Total descendants of Joseph?
How can I calculate the total   descendants of John or any of the grand
children?

Because each of the children also start having grand children, while Joseph
grand descendants increases.

I want to use MySql/PHP
The concept is Like http://www.disneytreasures.biz/ or ClubFreedom

All I want to do is to know who bring who?


Re: [PHP-DB] PHP4 and Constructor

2007-10-03 Thread Joseph Crawford
this is why for backwards compatibility with PHP 4 people usually do
this.  Note that if you use public/private/protected it probably will
not work on PHP 4

?php
class Foo
{
 function __construct($params)
 {
  $this-Foo($params);
 }

 function Foo($params)
 {
  // Actual Constructor
 }
}
?

On 10/4/07, Jean Molliné [EMAIL PROTECTED] wrote:
 Hi,
 In PHP4, the constructor has the same name as the class.

 class ClassName {
 function ClassName() {
 
 }
 }


 T K a écrit :
  Hi,
 
  I would like to use constructor in PHP4, but how do you make a constructor?
  In PHP5, I do like
 
  class ClassName {
 function __construct() {
  
  }
  }
 
  But PHP4 doesn't have such a thing as __construct()... Reading the
  official manual didn't make me understood. Does this mean the very
  first `function` in class is always the constructor for the Class?
 
  Tek
 
 



-- 
Joseph Crawford Jr.
Zend Certified Engineer
http://www.josephcrawford.com/
1-315-820-4244
[EMAIL PROTECTED]

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



Re: [PHP-DB] Classes and Includes

2005-12-13 Thread Joseph Crawford
include_once('database.php');


--
Joseph Crawford Jr.
Zend Certified Engineer
Codebowl Solutions, Inc.
1-802-671-2021
[EMAIL PROTECTED]


Re: [PHP-DB] Quick question

2005-12-08 Thread Joseph Crawford
ini_set('max_execution_time', 9600);
that's how you set the max_execution_time, i would assume the rest follow
the same format.

notice the time is in seconds.


--
Joseph Crawford Jr.
Zend Certified Engineer
Codebowl Solutions, Inc.
1-802-671-2021
[EMAIL PROTECTED]


[PHP-DB] Emails Bouncing

2005-12-08 Thread Joseph Crawford
I keep getting the following, can someone from the staff rectify this please


Your message

 To:
  Subject: Re: [PHP-DB] Restricting What's Retreived
 Sent: Thu Dec 08 09:56:44 2005


did not reach the following recipient(s):
[EMAIL PROTECTED] on Thu Dec 08 09:56:44 2005

 The e-mail account does not exist at the organization this message
 was sent to.  Check the e-mail address, or contact the recipient
 directly to find out the correct address.
 grisu.itxnet.local #5.1.1

Thanks,

--
Joseph Crawford Jr.
Zend Certified Engineer
Codebowl Solutions, Inc.
1-802-671-2021
[EMAIL PROTECTED]


Re: [PHP-DB] Google Style Search Results

2005-12-07 Thread Joseph Crawford
why not use substr?
$preview = substr($string, 0, 50) .'...';

it will probably cut off in the middle of a word, but you can use strpos and
check to see if the char is a space to get to the point you want.

--
Joseph Crawford Jr.
Zend Certified Engineer
Codebowl Solutions, Inc.
1-802-671-2021
[EMAIL PROTECTED]


Re: [PHP-DB] getting rows by an ID field or by another field in a table

2005-12-06 Thread Joseph Crawford
i would do something like

SELECT id, date, subject FROM journal LIMIT 20

ofcourse this would mean you have to add an id column to your table and i
would make that a primary key and auto_increment,

this way when you do the select you could do something like this

$res = mysql_query(SELECT id, date, subject FROM journal LIMIT 20);
echo 'table';
echo 'trtdSubject/tdtdDate/td/tr';
while($entry=mysql_fetch_array($res)) {
echo 'trtda href=details.php
?id='.$entry['id'].''.$entry['subject'].'/a/tdtd'.$entry['date'].'/td/tr';
}
echo '/table';


--
Joseph Crawford Jr.
Zend Certified Engineer
Codebowl Solutions, Inc.
1-802-671-2021
[EMAIL PROTECTED]


Re: [PHP-DB] Debugging

2005-12-02 Thread Joseph Crawford
zend studio client/server work hand in hand and are the best debugging tools
i have found ;)

install zend studio server on the web server and use the zend studio client
locally to debug.

--
Joseph Crawford Jr.
Zend Certified Engineer
Codebowl Solutions, Inc.
1-802-671-2021
[EMAIL PROTECTED]


Re: [PHP-DB] Suggestions please!

2005-11-22 Thread Joseph Crawford
you might want to create a table called perms and have each row contain a
user id and a perm for each

the way i have mine setup is a bit more complex but fully configurable.
Here's how i would set it up

user_permissions
- user_id
- action
- value

user_actions
- id
- title

users
- id
- username
- passwd

then to get the permissions i would use a user object maybe something like
this

class user {
var $_id;
var $_permissions;

function user() {
$this-loadPermissions();
}

function hasPermission($val) {
$perm = $this-getPermission($val);
if(isset($perm)  $perm == 1) return true;
else return false
}

function loadPermissions() {
global $db;
$res = $db-Query(SELECT user_permissions.value, user_actions.title value
FROM user_permissions INNER JOIN user_actions ON
user_permissions.action==user_actions.id
$data = $db-fetchAll($res);
return $data
}
}

Understand that this code will not work out of the box and no security
measures were implemented, i did this just to show an example ;)

In my system i have user permissions and group permissions, i load the group
permissions then override with the user permissions.

--
Joseph Crawford Jr.
Zend Certified Engineer
Codebowl Solutions, Inc.
1-802-671-2021
[EMAIL PROTECTED]


Re: [PHP-DB] Searching remote web sites for content

2005-10-22 Thread Joseph Crawford
you could probably use curl to grab the source for the page then use a regex
to see if your domain is found maybe something like

if(preg_match(/www\.domain\.com/is)) // match found
else // not found

dont quote me on the regex as i am not very good with regex, also you would
want a button in the admin area that you push to check and return the
results in a nice table. You would not want this check to run with every
page load as curl could be time consuming depending on the speed of the site
you are checking.


--
Joseph Crawford Jr.
Zend Certified Engineer
Codebowl Solutions, Inc.
1-802-671-2021
[EMAIL PROTECTED]


Re: [PHP-DB] Re: Subject: Searching remote web sites for content

2005-10-22 Thread Joseph Crawford
why do all that, if you know the address of the page that the link will
reside on just curl that page for the results and preg_match that.


--
Joseph Crawford Jr.
Zend Certified Engineer
Codebowl Solutions, Inc.
1-802-671-2021
[EMAIL PROTECTED]


Re: [PHP-DB] URL Forwarding in PHP...

2005-09-26 Thread Joseph Crawford
header(Location: http://www.php.net/;);

note that this cannot be set once any output has been sent to the browser.
atleast not without using output buffering.

--
Joseph Crawford Jr.
Zend Certified Engineer
Codebowl Solutions, Inc.
1-802-671-2021
[EMAIL PROTECTED]


[PHP-DB] Fwd: Code Optimization Help

2005-09-20 Thread Joseph Crawford
Hello Everyone,
 
I have some code that is using COM to interact with MS Word to create a mail 
merge based on my mysql database, however it is running dreadfully slow 
13.53846 seconds to be exact. This is only running on 34 records, i could 
imagine running this on a few hundred records not to mention thousand. Is 
COM usually this slow? These load times i believe to be accurate as they 
come from zend studio's profiler.
You can see screenshots of the profile @ 
http://codebowl.dontexist.net/bugs/MailMerge/ Below you will see my code, 
anything you guys see that i could do to speed this up quite a bit i would 
appreciate it. It seems the naughty methods are CreateHeader, 
CreateDataSource, CreateDocument.


CODE
=
?php

class MailMerge {
private $mm_data_dir;
private $obj;
private $fieldcnt;
private $rowcnt;
private $letter_template;
private $envelope_template;

public function __construct($list = null, $letter = 'Has_Site', $envelope = 
'Envelope', $data_dir = 'data/mailmerge') {
if(!is_array($list)) throw new Exception('Cannot Create A Mail Merge With An 
Empty List.');
$this-mm_data_dir = 'F:/htdocs/csaf/'.$data_dir;
$this-list = $list;
$this-letter_template = $letter;
$this-envelope_template = $envelope;
$this-initilize();

$this-CreateHeaderFile();
$this-CreateDataSource();
$this-CreateDocument($this-letter_template);
$this-CreateDocument($this-envelope_template);
}

public function __destruct() {
unlink($this-mm_data_dir.'/ds.doc');
unlink($this-mm_data_dir.'/header.doc');
}

private function initilize() {
$this-rowcnt = count($this-list);
$this-fieldcnt = count($this-list[0]);
}

private function Close() {
$this-obj-Documents-Close();
}

private function Quit() {
$this-obj-Quit(); 
}

private function Release() {
$this-obj = NULL; 
}

private function CreateHeaderFile() {
$this-obj = new COM(word.application) or die('Couldnt load Word!');
if(!is_object($this-obj)) throw new Exception('Unable to instanciate 
Word!');
$this-obj-Documents-Add();
$this-obj-ActiveDocument-Tables-Add($this-obj-Selection-Range,1,$this-fieldcnt);

for($i = 0; $i = $this-rowcnt; $i++) {
foreach($this-list[$i] as $key = $value) {
$this-obj-Selection-TypeText($key);
$this-obj-Selection-MoveRight();
} 
}
$this-obj-ActiveDocument-SaveAs($this-mm_data_dir.'/header.doc');
$this-Close();
$this-Quit();
$this-Release();
}

private function CreateDataSource() {
$this-obj = new COM(word.application);
if(!is_object($this-obj)) throw new Exception('Unable to instanciate 
Word!');
$this-obj-Documents-Add();
$this-obj-ActiveDocument-Tables-Add($this-obj-Selection-Range,$this-rowcnt,$this-fieldcnt);

for($i = 0; $i = $this-rowcnt; $i++) {
foreach($this-list[$i] as $key = $value) {
$this-obj-Selection-TypeText($value);
$this-obj-Selection-MoveRight();
}
}
$this-obj-ActiveDocument-SaveAs($this-mm_data_dir.'/ds.doc');
$this-Close();
$this-Quit();
$this-Release();
}

private function CreateDocument($template) {
$this-obj = new COM(word.application); 
if(!is_object($this-obj)) throw new Exception('Unable to instanciate 
Word!');
$this-obj-Documents-Open($this-mm_data_dir.'/'.$template.'.dot');
$this-obj-ActiveDocument-MailMerge-OpenHeaderSource($this-mm_data_dir.'/header.doc');
$this-obj-ActiveDocument-MailMerge-OpenDataSource($this-mm_data_dir.'/ds.doc');
$this-obj-ActiveDocument-MailMerge-Execute();
$this-obj-ActiveDocument-SaveAs($this-mm_data_dir.'/'.$template.'.doc');
$this-Close();
$this-Quit();
$this-Release();
}
}
? [EMAIL PROTECTED]

-- 
Joseph Crawford Jr.
Codebowl Solutions, Inc.
1-802-671-2021
[EMAIL PROTECTED]


[PHP-DB] Learning curve mysql--mssql

2005-07-25 Thread Joseph
Does anyone have an idea what the learning curve is going from using 
php/mysql--php/mssql? I am applying for a position which uses MS SQL 
Servers for a DB and ASP.NET (god forbid) for a front end and my only 
experience is WAMP. While I can convert over to php from ASP.NET, I am 
stuck with mssql. Anyone had any serious problems learning to use the two?


--thanks -u jzf

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



Re: [PHP-DB] Delivery reports about your e-mail

2005-07-01 Thread Joseph Crawford
i am getting those too, seems i talked to gmail and users are spoofing other 
gmail accounts ;(

not sure how we stop this or if we even can.


-- 
Joseph Crawford Jr.
Codebowl Solutions, Inc.
1-802-671-2021
[EMAIL PROTECTED]


Re: [PHP-DB] registration form with activation code sent to user

2005-06-16 Thread Joseph Crawford
i dont think a capcha is what they are looking for, rather a way to create a 
md5 or something that they can email a link to users to a page such as 
confirm.php?validate=MD5-HERE so that they can validate thier email.

Steps to do this
1.) Create the string maybe an MD5 based on the email they choose or 
something like that
2.) Store that string to the database somewhere
3.) Email the mail to the address specified with the url to the confirm page
3.) The user will check thier email and click the link to your confirm page, 
this will confirm that they did in fact check thier email.
4.) Mark the user as confirmed.

-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]


Re: [PHP-DB] registration form with activation code sent to user

2005-06-16 Thread Joseph Crawford
#2
Well when the user registers there will have to be a database table for 
members i assume, why not make a column confirmation or something and store 
this string there?

#3
Check into the mail() function, this will allow you to send custom headers 
etc.. You just create the body of the message something like this

$body = 'Thank you for registering with usbr';
$body .= 'You must now confirm your email address by clicking
herehttp://yourdomain.com/[EMAIL PROTECTED]code=sdjfhasf80g7ad9fgfg

the actual url for the clicking here link you need to create maybe something 
like a href=
yourdomain.com/[EMAIL 
PROTECTED]code=sdjfhasf80g7ad9fgfghttp://yourdomain.com/[EMAIL 
PROTECTED]code=sdjfhasf80g7ad9fgfgclicking
here/a

then you use the mail() function to send the mail to the users email 
address...

on the confirm.php page you should grabe the code and email using 
$_GET['code'] and $_GET['email'] then check the database for the users email 
and make sure the code matches the one in the database. If it does mark them 
as confirmed and let them proceed, if not well do nothing.

-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]


Re: [PHP-DB] Limiting Results

2005-05-19 Thread Joseph Crawford
You could always try the LIMIT keyword :)

select a.college, a.state, a.cd http://a.cd/, b.rep from a, b

where

a.state = al and a.cd http://a.cd/ = 3 or
a.state = az and a.cd http://a.cd/ = 1 and

a.state = b.state and
a.cd http://a.cd/ = b.cd http://b.cd/

LIMIT 50

-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]


Re: [PHP-DB] addslashes + stripslashes + mysql question

2005-05-16 Thread Joseph Crawford
you might want to check to see if magic quotes GPC is turned on, if it is 
then you are adding slashes twice. You can either turn it off or do not use 
addslashes ;)

-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]


Re: [PHP-DB] Getting information on ICQ

2005-05-07 Thread Joseph Crawford
i am sorry but what does this have to do with PHP?

-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]


Re: [PHP-DB] Test

2005-03-21 Thread Joseph Crawford
recieved


On Mon, 21 Mar 2005 12:50:46 +0100, Juffermans, Jos
[EMAIL PROTECTED] wrote:
 Sorry to use this, but I don't know if my messages are arriving...
 
 Can someone (only 1 please) reply that my message was received?
 
 Jos
 
 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]

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



Re: [PHP-DB] How to programmatically finding freetds.conf location?

2005-03-12 Thread Joseph Crawford
you could execute the exec command in php and run a locate
freetds.conf or whereis freetds.conf or find freetds.conf, i believe
whereis only locates binary files not sure though.

read up on exec here
http://us2.php.net/manual/en/function.exec.php


-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]

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



Re: [PHP-DB] most popular places

2005-02-25 Thread Joseph Crawford
the only way i can think of off the top of my head would not be
intense as you would have to do a foreach for each of the cities such
as
$qry = select * from table
$total = mysql_num_rows( $qry );
foreach( $cities as $city ) {
  // do db query such as
 // $qry = mysql_query(SELECT id FROM table where members=$city OR
pictures=$city OR reports=$city);
//$cities[$city] = $total / mysql_num_rows($qry); 

with something like this you would get an array, you could then sort
the array based on highest to lowest value, you could then display the
cities which are used the most, if you really want to get into the
details you could do seperate queries for the members, pictures,
reports and store them as such
$citites[$city]['members'] etc...

-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]

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



Re: [PHP-DB] mysql - image storing

2005-01-18 Thread Joseph Crawford
Jason, can you explain why stripslashes should not be used on data
taken from the db? when you store data in the db i thought it was good
practice to addslashes, when you retrieve from the db, you will need
to use stripslashes to remove the extra \


-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]

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



Re: [PHP-DB] Getting total results

2004-12-29 Thread Joseph Crawford
actually,

i was not doing anything with it because it was just the class.  The
way i use it is that i would store the object in a session variable
for use accross pages :D


-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]

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



Re: [PHP-DB] Site optimization

2004-12-28 Thread Joseph Crawford
i was wondering this as well :D

are there any tools out there to simulate high traffic on your web
server say where you specify how many users hit the site at one time
and the tool actually hits your server that many times?

-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]

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



Re: [PHP-DB] Getting total results

2004-12-28 Thread Joseph Crawford
this is a good method, however i created a paging class in php 5 and i
believe i still have it here locally in php 4

i will get the link soon :D


-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]

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



Re: [PHP-DB] Getting total results

2004-12-28 Thread Joseph Crawford
http://www.weberdev.com/get_example-4005.html
that is the url to the PHP 5 object i created, it was created to show
the use of the singleton pattern.  This means you can only use this
class to have one pager per page.
i can edit the code if you do not know how to make it so you can have
more than one per page.

the php 4 version i will need to zip up locally here and will post it @
http://codebowl.dontexist.org/pager_php4.zip


-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]

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



Re: [PHP-DB] Getting total results

2004-12-28 Thread Joseph Crawford
php 4 version is posted, let me know if you like it or not.  Please
keep in mind it is a very basic class, you could extend this in many
ways, especially to make the nav bar do something like  1 2 3 4 
 25 26 27 28 

-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]

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



Re: [PHP-DB] to many addresses

2004-12-27 Thread Joseph Crawford
one thought might be to check thier data for Str, St etc... and have
it automatically replace with Street.  Another would be to reload the
page and give them suggestions on what to use, if they do Rd, have a
drop down with Road, Street, Avenue etc.. so they can choose the
correct one.


-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]

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



Re: [PHP-DB] Re: sessions

2004-12-11 Thread Joseph Crawford
correct me if i am wrong but i have been told it is bad and insecure
to use register_global=on

i have seen many comercial scripts that rely on this and it just makes me laugh


On Sat, 11 Dec 2004 16:48:05 +0800, Shen Kong [EMAIL PROTECTED] wrote:
 Hi, if your register_global = on you can do it like you do, if
 register_global = off, use it like this:
 
 session_start();
 session_register(session_username); //or $_SESSION[session_username]
 = null;
 session_register(session_level); // or $_SESSION[session_level] = null;
 
 $_SESSION['session_username'] = $username;
 $_SESSION['session_level'] = $account_level;
 
 echo $_SESSION['session_username'];
 
 Warren Mason :
 
 
  I am attempting to get information from a mysql database and then use
  this in a session. Is there a trick to using sessions? For example, can
  something like below be placed anywhere in a script? (I have the
  session_start(); at the very top of my page.)
 
 
 
session_register( session_username );
session_register( session_level );
 
   $session_username = $username;
   $session_level = $account_level;
 
 
  The resulting session is
 
  session_username|N;session_level|i:0;
 
  $username is set to warren and $account_level is set to 255.
 
  Any help would be greatly appreciated as I have gone through about 5
  books and searched the net and can't find an answer as to why this isn't
  working.
 
 
  -
  This message is intended for the addressee named and may contain
  confidential information. If you are not the intended recipient, please
  delete it and notify the sender. Views expressed in this message are
  those of the individual sender and are not necessarily the views of the
  Mid Western Area Health Service.
  -
  gwavasig
 
 -- 
 -- ShenKong (shenkong(at)php.net)
 -- http://www.openphp.cn
 
 
 
 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]

For a GMail account
contact me OFF-LIST

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



Fwd: [PHP-DB] Data from a pull down menu

2004-12-10 Thread Joseph Crawford
-- Forwarded message --
From: Joseph Crawford [EMAIL PROTECTED]
Date: Fri, 10 Dec 2004 16:00:33 -0500
Subject: Re: [PHP-DB] Data from a pull down menu
To: [EMAIL PROTECTED]


well are you looking for an automatic page refresh when a name is
selected? If so you need to look into javascript for some help.  If
you have a go button or something like that what i would do is make
the drop down use the person's id and name such as

select name=person
option value=3Joe Crawford/option
/select

when the form is posted the value of $_POST['person'] will be 3, i
would use that to query the database and display any intormation that
i needed displayed.

--
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]


-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]

For a GMail account
contact me OFF-LIST

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



Re: [PHP-DB] php v jsp

2004-11-20 Thread Joseph Crawford
Depending on how you code, PHP can easilly be reused.

if you program procedurally it is much more difficult to reuse code
however it can be done through the use of including files.  If you go
for the object oriented approach, php is easy to expand and reuse the
code.  OO is also a cleaner more organized way to use PHP when working
in a team environment.

-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]

For a GMail account
contact me OFF-LIST

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



Re: [PHP-DB] Optimize Query Output

2004-11-20 Thread Joseph Crawford
the display really has nothing to do with SQL but rather your php
output format.  you would use php to display the data however you want
it formatted.


-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]

For a GMail account
contact me OFF-LIST

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



Re: [PHP-DB] Re: [users@httpd] November 2, 2004

2004-11-01 Thread Joseph Crawford
 Do we care? Realy? Unlikely. Maybe you should send your 'useful' info on
   a national mailinglist only.

i am sorry but i do care, if you do not care about voting you dont
care if the war comes to the US.

-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]

For a GMail account
contact me OFF-LIST

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



[PHP-DB] Session Objects, Dynamic Parameters

2004-10-04 Thread Joseph Crawford
Guys can anyone explain why this is returning odd results?

function getObject($class, $params=NULL) {
if (!is_array($_SESSION['objects'])) {
$_SESSION['objects'] = array();
}

if (!isset($_SESSION['objects'][$class])) {
if (is_array($params)) {
// this is what is erroring
$args = implode(, , array_map(paramType, $params));
echo $class.'('.$args.')';
$_SESSION['objects'][$class] = new $class($args);
} elseif($params != NULL) {
$_SESSION['objects'][$class] = new $class(paramType($params));
} else {
$_SESSION['objects'][$class] = new $class;
}
}

return $_SESSION['objects'][$class];
}

function paramType($var) {
if (is_string($var)) {
return '.$var.';
} else {
return $var;
}
}

when i call this

$dbParams = array(
'server' = 'localhost',
'database' = 'ipro2',
'username' = 'root',
'password' = '**'
);

$db = getObject('Mysql', $dbParams);
$db-connect();

it seems to take this, (which is the actual call in the getObject function
Mysql('localhost', 'database', 'user', '**')
it seems that 
'localhost', 'database', 'user', '**'
is being taken as one parameter, i am guessing because the getObject
function creates it as one string, my question is how can i get this
to think it is different arguments, i keep getting errors like this

mysql error: Unknown MySQL Server Host ''localhost', 'database',
'user', '**'' (-1)


-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]
802-558-5247

For a GMail account
contact me OFF-LIST

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



Re: [PHP-DB] Capturing a sql query

2004-10-01 Thread Joseph Crawford
Not so much that it is bad but you might be storing data you dont need
to, all you really need to store are the keywords the person has
searched for.

-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]
802-558-5247

For a GMail account
contact me OFF-LIST

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



Re: [PHP-DB] Capturing a sql query

2004-10-01 Thread Joseph Crawford
why do you need more than a varchar?
the persons keywords shouldnt be that much text for each agent maybe

PHP+Programming+Vermont

-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]
802-558-5247

For a GMail account
contact me OFF-LIST

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



Re: [PHP-DB] which DB to use?

2004-10-01 Thread Joseph Crawford
i am not a fan of microsoft go with mysql :)

-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]
802-558-5247

For a GMail account
contact me OFF-LIST

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



Re: [PHP-DB] String handling

2004-09-30 Thread Joseph Crawford
$string = '10001';
if((int)$string)  1) { echo 'Yep it is'; }


-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]
802-558-5247

For a GMail account
contact me OFF-LIST

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



Re: [PHP-DB] Capturing a sql query

2004-09-29 Thread Joseph Crawford
Stuart,

in this case what i would do is store the keywords, when they are on
the site they can click thier saved searches and it will basically do
an auto search with the saved keywords.  For the email way i think
they probably save the keywords as well but are using a cron job to
fetch the results and form the email.

Let me take a look at one of these sites to see what exactly you want
and can give a better explanation.


-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]
802-558-5247

For a GMail account
contact me OFF-LIST

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



Re: [PHP-DB] I have a query

2004-09-29 Thread Joseph Crawford
 I have database called asset
 in which 5 table are present namely asset1,asset2,asset3,asset4,asset5...
 
 all the tables have the same schema structure and common field names ,equal no of 
 columns(but not the equal number of rows)

why on earth would you do this?
rather i would create a database named site or something and a table
called asset_groups, here i would have
id (int 11 auto_increment primary_key)
title (varchar 50)

this is where i would store Asset1, Asset2 etc...

i would then have a table called assets and have that be sturectured like so
id (int 11 auto_increment primary_key)
asset (int 11) (ID of the asset_group)
whatever else you want for column names.

$result = mysql_query(SELECT id, title FROM asset_groups as ag INNER
JOIN assets a ON ag.id=a.asset WHERE a.asset_loc='heaven');
while($data=mysql_fetch_array($result)) {
// returned a row, display it or whatever
}
$result = null;
$data = null;

this would return a row containing everything you want and would allow
you to loop through the rows so you can display them or whatever


-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]
802-558-5247

For a GMail account
contact me OFF-LIST

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



Re: [PHP-DB] Capturing a sql query

2004-09-29 Thread Joseph Crawford
they are doing exactly what i thought on monster.com
here is an example url to save an agent


http://my.monster.com/modifyagents.asp?bq=programming+PHP+MySQL/bcn=lid=fn=554sort=rvvw=bcy=USbrd=1%2C1862%2C1863from=jssavesearch=on

the bold part above are the keywords searched for

it will basically save these into a database record and use a cron job
to pull the latest matches and send the emails.  also it just uses
those keywords when you use that agent on thier site.


-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]
802-558-5247

For a GMail account
contact me OFF-LIST

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



Re: [PHP-DB] Question on Registration Method

2004-09-26 Thread Joseph Crawford
that is done when they click the link in thier email

if they are sent to domain.com/page.php?code=X4rfkj490T

the code in page.php will $_GET['code'] and compare it to the one in
the database, if they match, flip the switch if not show an error.



On Sun, 26 Sep 2004 06:35:59 -0700 (PDT), Stuart Felenstein
[EMAIL PROTECTED] wrote:
 K...I've added the 2 columns, my names - activate and
 activate_hash.
 
 Upon registration, the activate_hash has a generated
 string inserted.  activate column is default to 0.
 I can compare it to the database - but not sure how to
 flip the switch on the activate column 0-1
 Is that done through an update mechanism ?
 
 Stuart
 
 
 
 --- Joseph Crawford [EMAIL PROTECTED] wrote:
 
  what i did is i used php to create a random string
  of numbers and
  letters about 15 chars long, then i store this in
  the db, and in the
  email i make the link
  page.php?code=RandomStringHere, then on the
  page.php i get the code and compare it to the ont in
  the database.  If
  they match activate the user otherwise show an
  error.
 
 
 
 
  On Sun, 26 Sep 2004 05:54:14 -0700 (PDT), Stuart
  Felenstein
  [EMAIL PROTECTED] wrote:
   Ok , I think this is along the lines of what I've
   started.  I added a column called active with a
   default to 0.  It's a tiny int since I'm think
   0=fales, 1=true.
  
   So can you explain a tad more about this hash
  stuff ?
   Is that specific to a sql field or just a name
  you've
   chose ?  I'm not sure what you mean in your last
   statement about the hash passing over to the
  activate
   column ?
  
   Stuart
  
  
   --- M Saleh EG [EMAIL PROTECTED] wrote:
  
I'd do it this way...
   
I'd add two column in the users table. 1-
  activated,
2- activation-hash
   
once the registeration form is ubmited..
a-the username and user info will be saved in
  the
users table.
b-an encrypted hash would be made n saved in
activation-hash column
and sent along with the registeration info
  (username
 pass) in the
form of a url (eg.
   
  
 
 http://domain/activationpage.php?hash=ljk;lkj;lkjl;ksjfasdfa).
   
if the user is activated then the login function
works for them if not
given a msg saying ur activation hasnt been done
yet
   
the activatepage.php should then put 1, or on in
  the
activated colum
in the users table on the row that has the hash
passed to it.
   
simple enought aint it?
   
   
On Sun, 26 Sep 2004 05:02:07 -0700 (PDT), Stuart
Felenstein
[EMAIL PROTECTED] wrote:
 Currently there are only 2 types of users
  planned
 Each has a basic access level.  I don't think
  this
is
 the same as a usergroup though.

 If I don't have usergroups, but access levels,
then
 perhaps I should set the level to some less
  then
what
 is required login till activated.

 Then it sounds like I have the system
  autogenerate
an
 activation code.

 Not sure what you mean by :
  a separate table holding information on how
  to
  activate (something
  along the lines of userid, tousergroup,
  activationcode).




 --- Oscar Rylin [EMAIL PROTECTED] wrote:

  Usergroups.
  Most likely, you're dealing with an
  application
  where you'll want to have
  different kinds of users (administrators,
  power
  users, users).
 
  Just make a usergroup for accounts that
  haven't
been
  activated yet.
  Also, a separate table holding information
  on
how to
  activate (something
  along the lines of userid, tousergroup,
  activationcode).
 
  / rylin
 

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


   
   
   
--
M.Saleh.E.G
97150-4779817
   
  
   --
   PHP Database Mailing List (http://www.php.net/)
   To unsubscribe, visit:
  http://www.php.net/unsub.php
  
  
 
 
 
  --
  Joseph Crawford Jr.
  Codebowl Solutions
  [EMAIL PROTECTED]
  802-558-5247
 
  For a GMail account
  contact me OFF-LIST
  
  --
 
 
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 



-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]
802-558-5247

For a GMail account
contact me OFF-LIST

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



Re: [PHP-DB] Question on Registration Method

2004-09-26 Thread Joseph Crawford
no you dont need a user id or anything, here is some sample code to
give you the idea

$result = mysql_query(SELECT fields FROM table WHERE code=.$_GET['code']);
if(mysql_num_rows($result)  0) {
  // we have a match, activate the account
  $result1 = mysql_query(UPDATE table SET activated=1 WHERE
code=.$_GET['code']);
  // show a page saying they are now activated
} else {
  // show an error
}


On Sun, 26 Sep 2004 07:18:54 -0700 (PDT), Stuart Felenstein
[EMAIL PROTECTED] wrote:
 Nothing like sharing my pain ;) sorry!
 It seems that in order to compare the code to the one
 in the database, don't I need the userid or something?
 
 or just that it exists in the database?
 
 Thank you,
 
 
 Stuart
 --- Joseph Crawford [EMAIL PROTECTED] wrote:
 
  what i did is i used php to create a random string
  of numbers and
  letters about 15 chars long, then i store this in
  the db, and in the
  email i make the link
  page.php?code=RandomStringHere, then on the
  page.php i get the code and compare it to the ont in
  the database.  If
  they match activate the user otherwise show an
  error.
 
 
 
 
  On Sun, 26 Sep 2004 05:54:14 -0700 (PDT), Stuart
  Felenstein
  [EMAIL PROTECTED] wrote:
   Ok , I think this is along the lines of what I've
   started.  I added a column called active with a
   default to 0.  It's a tiny int since I'm think
   0=fales, 1=true.
  
   So can you explain a tad more about this hash
  stuff ?
   Is that specific to a sql field or just a name
  you've
   chose ?  I'm not sure what you mean in your last
   statement about the hash passing over to the
  activate
   column ?
  
   Stuart
  
  
   --- M Saleh EG [EMAIL PROTECTED] wrote:
  
I'd do it this way...
   
I'd add two column in the users table. 1-
  activated,
2- activation-hash
   
once the registeration form is ubmited..
a-the username and user info will be saved in
  the
users table.
b-an encrypted hash would be made n saved in
activation-hash column
and sent along with the registeration info
  (username
 pass) in the
form of a url (eg.
   
  
 
 http://domain/activationpage.php?hash=ljk;lkj;lkjl;ksjfasdfa).
   
if the user is activated then the login function
works for them if not
given a msg saying ur activation hasnt been done
yet
   
the activatepage.php should then put 1, or on in
  the
activated colum
in the users table on the row that has the hash
passed to it.
   
simple enought aint it?
   
   
On Sun, 26 Sep 2004 05:02:07 -0700 (PDT), Stuart
Felenstein
[EMAIL PROTECTED] wrote:
 Currently there are only 2 types of users
  planned
 Each has a basic access level.  I don't think
  this
is
 the same as a usergroup though.

 If I don't have usergroups, but access levels,
then
 perhaps I should set the level to some less
  then
what
 is required login till activated.

 Then it sounds like I have the system
  autogenerate
an
 activation code.

 Not sure what you mean by :
  a separate table holding information on how
  to
  activate (something
  along the lines of userid, tousergroup,
  activationcode).




 --- Oscar Rylin [EMAIL PROTECTED] wrote:

  Usergroups.
  Most likely, you're dealing with an
  application
  where you'll want to have
  different kinds of users (administrators,
  power
  users, users).
 
  Just make a usergroup for accounts that
  haven't
been
  activated yet.
  Also, a separate table holding information
  on
how to
  activate (something
  along the lines of userid, tousergroup,
  activationcode).
 
  / rylin
 

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


   
   
   
--
M.Saleh.E.G
97150-4779817
   
  
   --
   PHP Database Mailing List (http://www.php.net/)
   To unsubscribe, visit:
  http://www.php.net/unsub.php
  
  
 
 
 
  --
  Joseph Crawford Jr.
  Codebowl Solutions
  [EMAIL PROTECTED]
  802-558-5247
 
  For a GMail account
  contact me OFF-LIST
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 



-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]
802-558-5247

For a GMail account
contact me OFF-LIST

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



Re: [PHP-DB] Question on Registration Method

2004-09-26 Thread Joseph Crawford
$_GET['activation_hash] is missing the end '


On Mon, 27 Sep 2004 03:20:22 +0800, Jason Wong [EMAIL PROTECTED] wrote:
 On Monday 27 September 2004 03:01, Stuart Felenstein wrote:
  How are they any different?
 
  I'm seeing the same thing as your method.
 
 These two methods are separate:
 
   - Send user a system generated password with which
   they can login and
   subsequently change.
 
 OR
 
   - Send user an activation link which once clicked on
   would activate them and
   allow them to choose a password.
 
 What is the advantage in sending someone a password AND making them click on a
 link to activate?
 
 --
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-db
 --
 /*
 A countryman between two lawyers is like a fish between two cats.
 -- Ben Franklin
 
 
 */
 
 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 



-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]
802-558-5247

For a GMail account
contact me OFF-LIST

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



Re: [PHP-DB] unsubscribe me

2004-09-22 Thread Joseph Crawford
also check john's signiture on how to unsubscribe ;)


On Wed, 22 Sep 2004 10:23:52 -0400, John Holmes
[EMAIL PROTECTED] wrote:
 From: CJ Koh [EMAIL PROTECTED]
  unsubscribe me
 
 I'm sorry, but you must phrase your request in the form of a question.
 
 ---John Holmes...
 
 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 



-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]
802-558-5247

For a GMail account
contact me OFF-LIST

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



[PHP-DB] Re: [nyphp-talk] Socket Errors

2004-09-17 Thread Joseph Crawford
yea i got it the servers are now back up and working perfectly ;)

anyone know of any private news servers i can get an account on free?

i have my ISP one however my app is not going to be hosted on my
machine and my ISP limits connections to ones using one of thier IP's
so my web host wont be able to connect to the account.

-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]
802-558-5247

For a GMail account
contact me OFF-LIST

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



[PHP-DB] Re: [nyphp-talk] Socket Errors

2004-09-17 Thread Joseph Crawford
yea i got it the servers are now back up and working perfectly ;)

anyone know of any private news servers i can get an account on free?

i have my ISP one however my app is not going to be hosted on my
machine and my ISP limits connections to ones using one of thier IP's
so my web host wont be able to connect to the account.

-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]
802-558-5247

For a GMail account
contact me OFF-LIST

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



[PHP-DB] Re: [nyphp-talk] Socket Errors

2004-09-17 Thread Joseph Crawford
yea i got it the servers are now back up and working perfectly ;)

anyone know of any private news servers i can get an account on free?

i have my ISP one however my app is not going to be hosted on my
machine and my ISP limits connections to ones using one of thier IP's
so my web host wont be able to connect to the account.


-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]
802-558-5247

For a GMail account
contact me OFF-LIST

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



Re: [PHP-DB] PHP 5 Error Handling

2004-09-15 Thread Joseph Crawford
guys thanks for the responses, i am sure i may be able to parse the
results of $e-getTrace() to get the results i want ;)


On Wed, 15 Sep 2004 09:25:05 -0500, Gary Every
[EMAIL PROTECTED] wrote:
 Good question. I've tried the __LINE__ and __FILE__ in my
 error-handling, but it does the same thing you're experiencing, getting
 the line in the function/method as opposed to the actual error line. The
 only way I've gone around it is whenever there may be an exception, such
 as a sql statement, etc I assign $line_no = __LINE__ and if an exception
 gets thrown, the $line_no is captured, and I can use the info to print
 to the logs or the screen or ...
 
 G.
 
 Gary Every
 Sr. UNIX Administrator
 Ingram Entertainment Inc.
 2 Ingram Blvd, La Vergne, TN 37089
 Pay It Forward!
 
 
 
 
 -Original Message-
 From: Joseph Crawford [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, September 14, 2004 5:55 AM
 To: [PHP-DB] Mailing List
 Subject: [PHP-DB] PHP 5 Error Handling
 
 Guys,
 
 i have been working with custom exception classes that extend the
 general exception.  Here is some code i have
 
public function command($cmd) {
if($cmd) {
$res = fputs($this-connection, $cmd);
$this-response = fgets($this-connection, 128);
switch($this-getCode()) {
case 500:
throw new CommandException($cmd);
break;
}
}
}
 
public function selectGroup($group) {
$this-group = $group;
if(substr($this-response,0,3) == 200) {
 
THIS IS THE LINE THAT THROWS THE ERROR
$this-command(NoSuchCommand\n);
 
$this-response = fgets($this-connection, 1024);
}
$info = split( , $this-response);
 
$this-first = $info[2];
$this-last = $info[3];
}
 
 now when the error is thrown and i do $e-getLine(); it shows the line
 of the file where the throw statement is.  Is there a way to make it
 show the actual line number of the line that is the error? the
 $this-command(NoSuchCommand\n); line.
 
 --
 Joseph Crawford Jr.
 Codebowl Solutions
 [EMAIL PROTECTED]
 802-558-5247
 
 For a GMail account
 contact me OFF-LIST
 
 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 



-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]
802-558-5247

For a GMail account
contact me OFF-LIST

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



[PHP-DB] PHP 5 Error Handling

2004-09-14 Thread Joseph Crawford
Guys,

i have been working with custom exception classes that extend the
general exception.  Here is some code i have

   public function command($cmd) {
   if($cmd) {
   $res = fputs($this-connection, $cmd);
   $this-response = fgets($this-connection, 128);
   switch($this-getCode()) {
   case 500:
   throw new CommandException($cmd);
   break;
   }
   }
   }

   public function selectGroup($group) {
   $this-group = $group;
   if(substr($this-response,0,3) == 200) {

   THIS IS THE LINE THAT THROWS THE ERROR
   $this-command(NoSuchCommand\n);

   $this-response = fgets($this-connection, 1024);
   }
   $info = split( , $this-response);

   $this-first = $info[2];
   $this-last = $info[3];
   }

now when the error is thrown and i do $e-getLine(); it shows the line
of the file where the throw statement is.  Is there a way to make it
show the actual line number of the line that is the error? the
$this-command(NoSuchCommand\n); line.

-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]
802-558-5247

For a GMail account
contact me OFF-LIST

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



Re: [PHP-DB] functions via event handlers

2004-09-06 Thread Joseph Crawford
the closest you could come is to make javascript functions call php
pages basically redirects that would call the php functions.

-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]
802-558-5247

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



[PHP-DB] PHP's Oracle interface

2004-04-19 Thread Joseph Burch
Foolks -

In building the Apache PHP-Oracle interface we have discovered a
discrepancy between the functions listed in the PHP on-line
documentation and the function list obtained by nm for libphp4.so.
Our UNIX Solaris  build comprises Apache_1.3.29, PHP-4.3.4, and the full
Enterprise edition of Oracle 9.2.0.1.0. For example, we see the function
reference in the PHP documentation for oci_connect() but find no
function by that name in the build. Rather, we see
oci_do_connect() instead.

Current PHP document seems to be describing features of an Oracle
interface that simply are not available.  Has anyone run onto this or
similar problems?

Thanks,

Joseph Burch
ITC-UNIX Systems
University of Virginia

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



Re: [PHP-DB] Help installing phpmysearch

2003-10-29 Thread Joseph Allard
Could you be a little more explicit?  I don't understand check phpinfo()?

Gary Every [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
But do you have php compiled --with-curl?
check phpinfo();


Gary Every
Sr. UNIX Administrator
Ingram Entertainment
(615) 287-4876
Pay It Forward
mailto:[EMAIL PROTECTED]
http://accessingram.com


 -Original Message-
 From: Joseph Allard [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, October 28, 2003 3:59 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Help installing phpmysearch


 I was trying to install phpmysearch but I get this error instead :

 On your system must have Curl compiled in PHP! - Please
 check www.php.net
 how you can do this.
 Set in your php.ini allow_call_time_pass_reference to On.

 Well, the problem is that it already says, ON! So, what is
 the actual
 problem?

 I have attached a copy of the php.ini file, so that you can see for
 yourself. Thanks.




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



[PHP-DB] Help installing phpmysearch

2003-10-28 Thread Joseph Allard
I was trying to install phpmysearch but I get this error instead :

On your system must have Curl compiled in PHP! - Please check www.php.net
how you can do this.
Set in your php.ini allow_call_time_pass_reference to On.

Well, the problem is that it already says, ON! So, what is the actual
problem?

I have attached a copy of the php.ini file, so that you can see for
yourself. Thanks.


begin 666 php_ini_temp.txt
M6U!(4%T-@T*.SL[.SL[.SL[.SL-[EMAIL PROTECTED] [#0H[.SL[.SL[.SL[
M.PT*.R!4:ES(ES('1H92!D969A=6QT('-E='1I;F=S(9I;[EMAIL PROTECTED](YE
M=R!02% @:6YS=%L;%T:6]NRX-[EMAIL PROTECTED]@95F875L=[EMAIL PROTECTED](ENW1A
M;QS(ETV5L9B!W:71H([EMAIL PROTECTED])A=EO;B!S=6ET86)L92!F;W(-
M[EMAIL PROTECTED]5V96QOUE;G0@'5R]S97,L(%N9 J3D]4*B!F;W(@')O9'5C
M=EO;B!P=7)P;W-ERX-[EMAIL PROTECTED]('-E=F5R86P@V5C=7)I='DM;W)I96YT
[EMAIL PROTECTED]VED97)A=EO;G,@=AA=!S:]U;[EMAIL PROTECTED]@=%K96X-[EMAIL 
PROTECTED]
M;W)E(=O:6YG(]N;EN92!W:71H('EO=7(@VET92P@QE87-E(-O;G-U
M;'0@AP+FEN:2UR96-O;6UE;F1E9 T*.R!A;F0@:'1T#HO+W!HYN970O
M;6%N=6%L+V5N+W-E8W5R:71Y+G!HX-@T*#0H[.SL[.SL[.SL[.SL[.SL[
M.SL[#0H[($%B;W5T('1H:7,@9FEL92 [#0H[.SL[.SL[.SL[.SL[.SL[.SL[
M#0H[(%1H:7,@9FEL92!C;VYTF]LR!M86YY(%S5C=',@;[EMAIL PROTECTED])W,@
M8F5H879I;W(N(!);B!OF1EB!F;W(@4$A0('1O#0H[(')E860@:70L(ET
M(UU[EMAIL PROTECTED]@;F%M960@)W!HYI;FDG+B @4$A0(QO;VMS(9OB!I=!I
M;B!T:[EMAIL PROTECTED]F5N= T*.R!W;W)K:6YG(1IF5C=]R2P@:[EMAIL PROTECTED]AE('!A
M=@@95S:6=N871E9!B2!T:[EMAIL PROTECTED]:7)O;FUE;[EMAIL PROTECTED]:6%B;4-CL@
M4$A04D,L(%N9!I;B!T:4@%T:!T:%T('=AR!D969I;F5D(EN(-O
M;7!I;[EMAIL PROTECTED]EM92 H:[EMAIL 
PROTECTED]AA=!OF1EBDN#0H[(%5N95R(%=I;F1O=W,L
M('1H92!C;VUP:6QE+71I;64@%T:!IR!T:[EMAIL PROTECTED]]WR!D:7)E8W1O
MGDN(!4:4-CL@%T:!I;B!W:EC:!T:4@AP+FEN:2!F:6QE(ES
M(QO;VME9!F;W(@8V%N()E(]V97)R:[EMAIL PROTECTED];F-[EMAIL PROTECTED]AE(UC
M(%R9W5M96YT(EN(-O;6UA;F0@;EN92!M;[EMAIL PROTECTED]:4@WEN
M=%X(]F('1H92!F:6QE(ES(5X=')E;65L2!S:6UP;4N(!7:ET97-P
M86-E(%N9!,:6YEPT*.R!B96=I;FYI;F@=VET:!A('-E;6EC;VQO;B!A
MF4@VEL96YT;'D@:6=N;W)E9 H87,@6]U('!R;V)A8FQY(=U97-S960I
[EMAIL PROTECTED]:6]N(AE861EG,@*[EMAIL PROTECTED];UTI(%R92!A;'-O('-I
M;5N=QY(EG;F]R960L([EMAIL PROTECTED]AO=6=H#0H[('1H97D@;6EG:'0@;65A
M;B!S;VUE=AI;F@:[EMAIL PROTECTED]AE(9U='5R92X-CL-[EMAIL PROTECTED]ER96-T:79ER!A
MF4@W!E8VEF:65D('5S:6YG('1H92!F;VQL;W=I;F@WEN=[EMAIL PROTECTED]
M:7)E8W1I=F4@/2!V86QU90T*.R!$:7)E8W1I=F4@;F%M97,@87)E(IC87-E
M('-E;G-I=[EMAIL PROTECTED];V\]8F%R(ES(1I9F9EF5N=!FF]M($9/3SUB
M87(N#0H[#0H[([EMAIL PROTECTED]@82!S=')I;FL($@;G5M8F5R
M+!A(%!(4!C;VYS=%N= H92YG+B!%7T%,3!OB!-7U!)*2P@;VYE#0H[
M(]F('1H92!)[EMAIL PROTECTED]W1A;G1S(A/;[EMAIL PROTECTED]!4G5E+!86QS92P@
M665S+!.;R!A;[EMAIL PROTECTED]@;W(@[EMAIL PROTECTED]F5SVEO;@T*.R H92YG+B!%
M7T%,3 F('Y%7TY/5$E#12DL(]R($@75O=5D('-TFEN9R H(F9O;R(I
[EMAIL PROTECTED]'!R97-S:6]NR!I;B!T:[EMAIL PROTECTED])(9I;[EMAIL 
PROTECTED])E(QI;6ET
[EMAIL PROTECTED][EMAIL PROTECTED]5R871OG,@86YD('!AF5N=AE[EMAIL PROTECTED]
M( @( @(!B:71W:7-E($]2#0H[(8@( @( @()I='=I[EMAIL PROTECTED]
M('X@( @( @()I='=I[EMAIL PROTECTED]($@( @( @()O;[EMAIL PROTECTED]
M#0H[#0H[($)O;[EMAIL PROTECTED],@8V%N()E('1UFYE9!O;B!UVEN9R!T
M:[EMAIL PROTECTED](#$L($]N+!4G5E(]R(%EERX-[EMAIL PROTECTED]AE[EMAIL 
PROTECTED]@
M='5R;F5D(]F9B!UVEN9R!T:[EMAIL PROTECTED](# L([EMAIL PROTECTED]V4@;W(@
M3F\N#0H[#0H[($%N(5M'1Y('-T[EMAIL PROTECTED]@95N;W1E9!B2!S
M:6UP;'D@;F]T('=R:71I;F@86YY=AI;F@869T97(@=AE(5Q=6%L#0H[
M('-I9VXL(]R()Y('5S:6YG('1H92!.;VYE(ME7=OF0Z#0H[#0H[(!F
M;V\@/2 @( @( @(#L@V5TR!F;[EMAIL PROTECTED][EMAIL PROTECTED]@96UP='D@W1R:6YG#0H[
M(!F;V\@/2!N;VYE( @(#L@V5TR!F;[EMAIL PROTECTED][EMAIL PROTECTED]@96UP='D@W1R:6YG
M#0H[(!F;V\@/2 B;F]N92(@(#L@V5TR!F;[EMAIL PROTECTED][EMAIL PROTECTED]AE('-TFEN9R 
G
M;F]N92-CL-[EMAIL PROTECTED]@6]U('5S92!C;VYS=%N=',@:6X@6]UB!V86QU
[EMAIL PROTECTED]('1H97-E(-O;G-T86YTR!B96QO;F@=[EMAIL PROTECTED]6YA;6EC
M86QL2!L;[EMAIL PROTECTED]:6]N(AE:71H97(@82!02% @97AT96YS:6]N
M(]R([EMAIL PROTECTED]!E'1E;G-I;VXI+ T*.R!Y;W4@;6%Y(]N;'[EMAIL PROTECTED]('1H
M97-E(-O;G-T86YTR J869T97(J('1H92!L:6YE('1H870@;]A9',@=AE
M(5X=5NVEO;BX-CL-[EMAIL PROTECTED]('1H92!V86QU97,@:[EMAIL PROTECTED]AE('!HYI
M;FDM9ES=!F:6QE(-OG)EW!O;[EMAIL PROTECTED][EMAIL 
PROTECTED]AE()U:6QT:6X-[EMAIL PROTECTED]5F
M875L=',@*'1H870@:7,L(EF(YO('!HYI;FD@:7,@=7-E9P@;W(@:68@
M6]U(1E;5T92!T:5S92!L:6YERP-[EMAIL PROTECTED]AE()U:6QT:[EMAIL PROTECTED]5F875L
M=',@=VEL;!B92!I95N=[EMAIL PROTECTED]CL[.SL[.SL[.SL[.SL[.SL[
M.SL[#0H[($QA;F=U86=E($]P=EO;G,@.PT*.SL[.SL[.SL[.SL[.SL[.SL[
M.SL-@T*.R!%;F%B;[EMAIL PROTECTED]AE(%!(4!S8W)I'1I;F@;[EMAIL PROTECTED]
M:6YE('5N95R($%P86-H92X-F5N9VEN92 ]($]N#0H-[EMAIL PROTECTED];W@=AE
M(#P_('1A9RX@($]T:5R=VES92P@;VYL2 \/W!H!A;F0@/'-CFEP=#X@
M=%GR!AF4@F5C;V=N:7IE9X@( T*.R!.3U1%.B!5VEN9R!S:]R=!T
M86=S('-H;W5L9!B92!A=F]I95D('[EMAIL PROTECTED]5V96QOEN9R!A'!L:6-A
M=EO;G,@;W(-CL@;EBF%R:65S('[EMAIL PROTECTED])E(UE86YT(9OB!R961I
MW1R:6)U=EO;BP@;W(@95P;]Y;65N=!O;B!02% -CL@V5R=F5RR!W
M:EC:!AF4@;F]T('5N95R('EO=7(@8V]N=')O;[EMAIL PROTECTED]:]R
M=!T86=S(UA2!N;W0-[EMAIL PROTECTED]@W5P]R=5D(]N('1H92!T87)G970@

[PHP-DB] PHP2 Forum Crashed

2003-10-28 Thread Joseph Allard
Now, I two seperate problems with two different websites.

My PHP2 Forum crashed along with the rest of my
website --www.dutchspecialops.com. I called GoDaddy.Com, my host provider
and they said that the problem was with us not with their server. However,
my web designer insist that it is a parse problem. What should I do and how
can I find out what the real problem is?

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



[PHP-DB] Failed Install

2003-10-22 Thread Joseph Allard
This what I got when I tried to install the PHP Forum:

Warning: main(./config.php) [function.main]: failed to create stream:
Permission denied in /home/content/j/i/g/jigger/html/common.php on line 111

Warning: main() [function.main]: Failed opening './config.php' for inclusion
(include_path='.:/usr/local/lib/php') in
/home/content/j/i/g/jigger/html/common.php on line 111

Warning: Cannot modify header information - headers already sent by (output
started at /home/content/j/i/g/jigger/html/common.php:111) in
/home/content/j/i/g/jigger/html/common

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



[PHP-DB] Re: removing a # from a string

2003-07-02 Thread Joseph Szobody
 How would I remove a # from a string?

 I want #2 to be 2.


$str = #2;
$str = str_replace(#,,$str);


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



[PHP-DB] mysqld ending at start up

2003-03-28 Thread Joseph Bannon
The mysql support list is slow, so I though I would
post here since I know this list is more active. MySQL
shuts down when I start it up...

Starting mysqld daemon with databases
from/home/mysqldb
030328 09:29:32  mysqld ended


__
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

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



RE: [PHP-DB] mysqld ending at start up

2003-03-28 Thread Joseph Bannon
 Usually means you have an error in your my.cnf file.


Is the my.cnf file a new thing with mysql because I
heard about it for the first time today?

Is there a way to configtest the my.cnf file like
there is with apache?

Thanks,

J



__
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

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



Re: [PHP-DB] PHP and Sendmail

2003-03-16 Thread Joseph Szobody
Chris,

Check out this PHP class. It's pretty impressive.

http://phpmailer.sourceforge.net/

Joseph

Chris Payne [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]
 Hi there,
 
 I have an SMTP server on here (Imail) - how would I use it with PHP?  Any
 tips to send a quick email as a test?
 
 Thank you :-)
 
 Chris
 
  You have two options. First option is to get sendmail for windows.
  You're going to pay for this, but there is a sendmail replacement for
  windows out there that most people don't know about. I've used it and
  it's really excellent. The only think you would have to change is the
  location of sendmail in your php.ini. You can find it at
  http://www.indigostar.com. It'll cost you about $50, but it's well worth
  it if you need sendmail functionality in windows. Of course, with PHP
  your best bet is to just use the built in SMTP support that comes with
  it. As long as you have access to an SMTP server you don't need
  sendmail. I use both, but I only use the sendmail app with perl apps and
  stuff like that, I just have PHP send stuff straight to the SMTP server.
 
  Nick
 
  Chris Payne wrote:
 
  Hi there everyone,
  
  I might soon be moving my server from Linux to Windows, and I was
 wondering if I will have to rewrite my PHP - Sendmail code to work on
 Windows Apache?  Or is there a better system than sendmail for PHP on
 Windows?
  
  Oh BTW it has to support HTML.
  
  Please help. if I do have to rewrite my form code it will take weeks LOL
 :-)
  
  Thanks
  
  Chris
  
  
 
 
 
 
  --
  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 unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] OCIBindByName with Oracle 8i17 problem ?!

2002-11-07 Thread Fabien JOSEPH
Thies C. Arntzen wrote:


On Mon, Nov 04, 2002 at 06:16:04PM +0100, Fabien JOSEPH wrote:
 

I discovered recently that it was impossible to bind an output
placeholder plsql (an input work only).

Configuration 1 : Suse + Oracle 8i17 + oci (oracle) + PHP4.2.3
Configuration 2 : HPUX11 + Oracle 8i17 + oci(oracle) + PHP4.2.3
Configuration 3 : HPUX11 + Oracle 8i17 + oci(oracle) + PHP4.2.2

With script :
inoutdemo.sql
CREATE OR REPLACE PROCEDURE inoutdemo (par_in IN VARCHAR2, 
par_in_out IN
OUT VARCHAR2,   par_out OUT VARCHAR2)   IS  BEGIN  
par_out:=par_in;
par_in_out:=par_in||' '||par_in_out;END;

$db=OCILogon(toto,titi);  
$stmt=OCIParse($db,BEGIN inoutdemo(:in,:inout,:out);END;);
OCIBindByName($stmt,:in,$in,32);
OCIBindByName($stmt,:inout,$inout,32);
OCIBindByName($stmt,:out,$out,32);
$in=Hello ;   
$inout=World!;
OCIExecute($stmt);  
echo $in.\n.$inout.\n.$out.\n;


//Result
Warning: OCIStmtExecute: ORA-06550: line 1, column 17: PLS-00553:
character set name is not recognized ORA-06550: line 0, column 0:
   

 

 i'd say you have a problem with your NLS_LANG setting.
 re,
 tc
 

PL/SQL: Compilation unit analysis terminated in
/opt/apache/htdocs/fab.php4 on line 58
Hello 
World! 

I tested this script with the 3 configurations but it's the same error

I changed $in, inout , out into $in, $out, $inout but it's the same
error

Please help me !!!


Fabien JOSEPH

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


 

Thank you for your help but finally I resolved my problem. It was my 
compilation of php.
Before my compilation of phpI, forgot to set LD_LIBRARY_PATH to 
$ORACLE_HOME/lib.

Recently, I compiled again my php but this time I set LD_LIBRARY_PATH 
before the compilation.

And finally when I finished to compile my php, I test my script again 
and it's work.


Fabien JOSEPH








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



Re: [PHP-DB] OCIBindByName with Oracle 8i17 problem ?!

2002-11-05 Thread Fabien JOSEPH
Thies C. Arntzen wrote:


On Mon, Nov 04, 2002 at 06:16:04PM +0100, Fabien JOSEPH wrote:
 

I discovered recently that it was impossible to bind an output
placeholder plsql (an input work only).

Configuration 1 : Suse + Oracle 8i17 + oci (oracle) + PHP4.2.3
Configuration 2 : HPUX11 + Oracle 8i17 + oci(oracle) + PHP4.2.3
Configuration 3 : HPUX11 + Oracle 8i17 + oci(oracle) + PHP4.2.2

With script :
inoutdemo.sql
CREATE OR REPLACE PROCEDURE inoutdemo (par_in IN VARCHAR2, 
par_in_out IN
OUT VARCHAR2,   par_out OUT VARCHAR2)   IS  BEGIN  
par_out:=par_in;
par_in_out:=par_in||' '||par_in_out;END;

$db=OCILogon(toto,titi);  
$stmt=OCIParse($db,BEGIN inoutdemo(:in,:inout,:out);END;);
OCIBindByName($stmt,:in,$in,32);
OCIBindByName($stmt,:inout,$inout,32);
OCIBindByName($stmt,:out,$out,32);
$in=Hello ;   
$inout=World!;
OCIExecute($stmt);  
echo $in.\n.$inout.\n.$out.\n;


//Result
Warning: OCIStmtExecute: ORA-06550: line 1, column 17: PLS-00553:
character set name is not recognized ORA-06550: line 0, column 0:
   

 

 i'd say you have a problem with your NLS_LANG setting.
 re,
 tc
 

PL/SQL: Compilation unit analysis terminated in
/opt/apache/htdocs/fab.php4 on line 58
Hello 
World! 

I tested this script with the 3 configurations but it's the same error

I changed $in, inout , out into $in, $out, $inout but it's the same
error

Please help me !!!


Fabien JOSEPH

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


 

Thank you for your help but I set the NLS_LANG in my profile of  user 
Oracle,  and it's the same result.

But I think it's not just the problem of the conversion of string

The proof, I change my sql into :

inoutdemo_number.sql
CREATE OR REPLACE PROCEDURE inoutdemo_number (
	par_in IN NUMBER, 
	par_in_out IN OUT NUMBER,   
	par_out OUT NUMBER)   
IS  BEGIN  
	par_out:=par_in;
	par_in_out:=par_in+1000;
END;

putenv( ORACLE_HOME=/logi/ora817 );
putenv( ORACLE_SID=MON_SID );
putenv (NLS_LANG=french_france.we8iso8859p1);
putenv (ORA_NLS33=/logi/ora817/ocommon/nls/admin/data);

$db=OCILogon(toto,titi);  
$stmt=OCIParse($db,BEGIN inoutdemo_number(:in,:inout,:out);END;);
OCIBindByName($stmt,:in,$in,32);
OCIBindByName($stmt,:inout,$inout,32);
OCIBindByName($stmt,:out,$out,32);
$in=5;   
$inout=5;
OCIExecute($stmt);  
echo $in.\n.$inout.\n.$out.\n;

Result :
br /
bWarning/b:  OCIStmtExecute: ORA-06550: line 1, column 13:
PLS-00553: character set name is not recognized
ORA-06550: line 0, column 0:
PL/SQL: Compilation unit analysis terminated
in b/opt/apache/htdocs/fab.php4/b on line b60/bbr /
5
6

Conclusion, OciBindDyName with number (output) doesn't work.

It is strange PHP.





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



[PHP-DB] OCIBindByName with Oracle 8i17 problem ?!

2002-11-04 Thread Fabien JOSEPH
I discovered recently that it was impossible to bind an output
placeholder plsql (an input work only).

Configuration 1 : Suse + Oracle 8i17 + oci (oracle) + PHP4.2.3
Configuration 2 : HPUX11 + Oracle 8i17 + oci(oracle) + PHP4.2.3
Configuration 3 : HPUX11 + Oracle 8i17 + oci(oracle) + PHP4.2.2

With script :
inoutdemo.sql
CREATE OR REPLACE PROCEDURE inoutdemo (par_in IN VARCHAR2, 
par_in_out IN
OUT VARCHAR2,   par_out OUT VARCHAR2)   IS  BEGIN  
par_out:=par_in;
par_in_out:=par_in||' '||par_in_out;END;

$db=OCILogon(toto,titi);  
$stmt=OCIParse($db,BEGIN inoutdemo(:in,:inout,:out);END;);
OCIBindByName($stmt,:in,$in,32);
OCIBindByName($stmt,:inout,$inout,32);
OCIBindByName($stmt,:out,$out,32);
$in=Hello ;   
$inout=World!;
OCIExecute($stmt);  
echo $in.\n.$inout.\n.$out.\n;


//Result
Warning: OCIStmtExecute: ORA-06550: line 1, column 17: PLS-00553:
character set name is not recognized ORA-06550: line 0, column 0:
PL/SQL: Compilation unit analysis terminated in
/opt/apache/htdocs/fab.php4 on line 58
Hello 
World! 

I tested this script with the 3 configurations but it's the same error

I changed $in, inout , out into $in, $out, $inout but it's the same
error

Please help me !!!


Fabien JOSEPH

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




[PHP-DB] Re: can OCIBindByName bind an in/out placeholder of plsql

2002-10-31 Thread Fabien JOSEPH
I discovered recently that it was impossible to bind an output
placeholder plsql (an input work only).

Configuration 1 : Suse + Oracle 8i17 + oci (oracle) + PHP4.2.3
Configuration 2 : HPUX11 + Oracle 8i17 + oci(oracle) + PHP4.2.3
Configuration 3 : HPUX11 + Oracle 8i17 + oci(oracle) + PHP4.2.2

With script :
inoutdemo.sql
CREATE OR REPLACE PROCEDURE inoutdemo (par_in IN VARCHAR2, 
par_in_out IN
OUT VARCHAR2,   par_out OUT VARCHAR2)   IS  BEGIN  
par_out:=par_in;
par_in_out:=par_in||' '||par_in_out;END;

$db=OCILogon(usr_adm,adm_inv);  
$stmt=OCIParse($db,BEGIN inoutdemo(:in,:inout,:out);END;);
OCIBindByName($stmt,:in,$in,32);
OCIBindByName($stmt,:inout,$inout,32);
OCIBindByName($stmt,:out,$out,32);
$in=Hello ;   
$inout=World!;
OCIExecute($stmt);  
echo $in.\n.$inout.\n.$out.\n;


//Result
Warning: OCIStmtExecute: ORA-06550: line 1, column 17: PLS-00553:
character set name is not recognized ORA-06550: line 0, column 0:
PL/SQL: Compilation unit analysis terminated in
/opt/apache/htdocs/fab.php4 on line 58
Hello 
World! 

I tested this script with the 3 configuration but it's the same error

I changed $in, inout , out into $in, $out, $inout but it's the same
error

Please help me !!!


Fabien JOSEPH

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




[PHP-DB] PHP, dates, and MySQL data comparisons

2002-10-01 Thread Joseph Szobody

I have a table with a Date field (-mm-dd) and I would like to retrieve all rows 
with the date less than one week ago.

Something like SELECT FROM table WHERE date  one_week_ago_today.

This seems like it should be so simple... yet I'm not getting it.

Any help is appreciated.

Thanks,

Joseph


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




[PHP-DB] PHP - MSSQL

2002-09-20 Thread Joseph Szobody

Folks...

I have a situation where I need a Visual Basic program, running on a win2k server to 
store some data. I later need a PHP script to come along, retrieve and parse that 
data. I have a MS SQL server running on the win2k server along with the VP program. I 
then have a RedHat/Apache box that the PHP script is running on, which also has MySQL.

My first thought was to have the VP app store the data in a MS SQL table (since this 
is the easiest for the VP programmer), and then I (the PHP programmer) would have to 
figure out how to connect the the MS SQL table with PHP. I know this is possible, but 
I've also heard it can be messy (recompiling PHP. installing odbc drivers which 
sometimes give errors etc).

The other option, is to do it the other way around. Have the VB guy write the data to 
a MySQL table, which then would be a piece of cake for me to retrieve with PHP. What I 
don't know, is how easy it is for VB to talk to MySQL.

Anyone have experience with either way? I know PHP fairly well, but I'm not too sure 
about the installation/compiling/etc process to get odbc working.

Any tips or advice would be appreciated. Thanks!


Joseph


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




[PHP-DB] Page loading

2001-12-14 Thread Christopher Joseph

Apologies for xposting.

Also for irrelevence
I have three different php applications running on my web site in thre
different directories. All display the pages correctly when I point my
browser at them.

I have just installed a fourth in a directory at the same subdirectory level
as the others and the PHP pages are not parsedinstead I am prompted to
donwload. I thought at first it may be a connection issue to the db but then
surely i would have an error message. I put a phpinfo() page into the
directory and the same thing happens.I am prompted for download by IE

Help.


-- 
PHP Database 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]




Re: [PHP-DB] Modify Query, or sift through results?

2001-06-29 Thread Joseph Koenig

My Last post was incorrect - sorry. My correct sql statement would be
rlike (^|;)Midwest(;|$).

Someone mentioned using Distinct before, which wouldn't work because
Distinct acts on a field, to my understanding, so Northwest;East would
be different than Northwest;South so it wouldn't really give me the
results I'm looking for. Someone else mentioned FIND_IN_STR, which I had
previously tried. That will find 'North' in 'Northeast' because 'North'
is in the string. Doing a Reg Exp allows me to find exactly what I'm
looking for, but with a little flexability to account for the semicolons
and what not. Hopefully someone else has learned something too :)

Joe

Jason Stechschulte wrote:
 
 On Wed, Jun 27, 2001 at 08:54:04AM -0500, Joseph Koenig wrote:
  I've got a script that searches a db every night and sends out e-mail if
  it finds something a person would be interested in, based on criteria
  they gave us. The problem is that I have one field that stores regions
  of the country in a very unpleasant way. It stores them as:
 
  Northeast;West;South
 
  So all of the regions for one record go into one field. The problem is
  that when searching that, if someone has a preference  of 'North', I
  dont want to pull records that have 'Northeast', as would happen with
  the above example. Is there a way to modify the MySQL query so as to
  find only 'North', keeping in mind that 'North' may be the 3rd in a list
  of semi-colon separated regions? Or do I need to sift through the
  results in PHP to clean them up? Thanks,
 
 You can certainly have MySQL do the work.  I can't modify your query,
 because you didn't give it to us, but I can give you an example.
 
 ?php
 $sql = select * from your_table where your_column rlike North(;|$);
 ?
 
 This will do a regular expression match.  If either North with a semicolon
 directly after it or North and the end of the string is found, the
 row will be returned.
 
 --
 Jason Stechschulte
 [EMAIL PROTECTED]
 --
 If you're going to define a shortcut, then make it the base [sic] darn
 shortcut you can.
  -- Larry Wall in [EMAIL PROTECTED]

-- 
PHP Database 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]




Re: [PHP-DB] Modify Query, or sift through results?

2001-06-28 Thread Joseph Koenig

Ah ha..now it looks like we're on to something. I had to modify it a
bit, but it worked...for the most part. I had to make it rlike
North[;|$]. But here's the next problem...I have a region 'Midwest'
and 'Upper Midwest'. When I do this search for Midwest, I get the 'Upper
Midwest' results also. So I tried rlike [^|;]Midwest[;|$] which
returned no results. If I'm thinking correctly, that should be saying:

Find the beginning of a string, or a semicolon, then Midwest, then a
semicolon, or the end of a string.

Is that correct? Thanks,

Joe

Jason Stechschulte wrote:
 
 On Wed, Jun 27, 2001 at 08:54:04AM -0500, Joseph Koenig wrote:
  I've got a script that searches a db every night and sends out e-mail if
  it finds something a person would be interested in, based on criteria
  they gave us. The problem is that I have one field that stores regions
  of the country in a very unpleasant way. It stores them as:
 
  Northeast;West;South
 
  So all of the regions for one record go into one field. The problem is
  that when searching that, if someone has a preference  of 'North', I
  dont want to pull records that have 'Northeast', as would happen with
  the above example. Is there a way to modify the MySQL query so as to
  find only 'North', keeping in mind that 'North' may be the 3rd in a list
  of semi-colon separated regions? Or do I need to sift through the
  results in PHP to clean them up? Thanks,
 
 You can certainly have MySQL do the work.  I can't modify your query,
 because you didn't give it to us, but I can give you an example.
 
 ?php
 $sql = select * from your_table where your_column rlike North(;|$);
 ?
 
 This will do a regular expression match.  If either North with a semicolon
 directly after it or North and the end of the string is found, the
 row will be returned.
 
 --
 Jason Stechschulte
 [EMAIL PROTECTED]
 --
 If you're going to define a shortcut, then make it the base [sic] darn
 shortcut you can.
  -- Larry Wall in [EMAIL PROTECTED]

-- 
PHP Database 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-DB] Modify Query, or sift through results?

2001-06-27 Thread Joseph Koenig

I've got a script that searches a db every night and sends out e-mail if
it finds something a person would be interested in, based on criteria
they gave us. The problem is that I have one field that stores regions
of the country in a very unpleasant way. It stores them as:

Northeast;West;South

So all of the regions for one record go into one field. The problem is
that when searching that, if someone has a preference  of 'North', I
dont want to pull records that have 'Northeast', as would happen with
the above example. Is there a way to modify the MySQL query so as to
find only 'North', keeping in mind that 'North' may be the 3rd in a list
of semi-colon separated regions? Or do I need to sift through the
results in PHP to clean them up? Thanks,

Joe

-- 
PHP Database 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-DB] Connect to MySQL from different computer

2001-04-11 Thread Paulson, Joseph V. \Jay\

Hello-
I was wondering how do I connect to a MySQL database, using php, when php
and MySQL are on two separate computers?
Thanks,
Jay

-- 
PHP Database 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]




  1   2   >