[PHP] Re: mysql question

2007-07-16 Thread Daniel Kullik
Man-wai Chang wrote: I tried to post to mysql.general, but the message never appeared. So I am trying my luck here. How could I build an index for a table created using the CREATE TEMPORARY TABLE ... SELECT ... FROM ... syntax, using an account without the privilege to use ALTER TABLE?

[PHP] Re: Array to Object

2007-02-13 Thread Daniel Kullik
Eli wrote: Hi, Having this array: $arr = array( 'my var'='My Value' ); Notice the space in 'my var'. Converted to object: $obj = (object)$arr; How can I access $arr['my var'] in $obj ? -thanks! print $obj-{'my var'}; $obj-{'my var'} = 'My New Value'; print $obj-{'my var'}; --

[PHP] Re: classes and objects: php5. The Basics

2007-01-16 Thread Daniel Kullik
Cheseldine, D. L. wrote: Hi I'm stuck on The Basics page of the php5 Object Model: http://uk.php.net/manual/en/language.oop5.basic.php The top example has the code: A::foo(); even though foo is not declared static in its class. How does it get called statically without being declared

Re: [PHP] Lost session variables still confounding me

2004-11-04 Thread Daniel Kullik
Stuart Felenstein wrote: --- Jason Wong [EMAIL PROTECTED] wrote: Maybe what you had before was: if (count($myarray) 5) $_SESSION['arrayerr'] = you have selected too many industries; session_write_close(); header (Location: Page2.php?.SID); exit; And yes that has a

[PHP] Re: Searching My Database

2004-09-29 Thread Daniel Kullik
Harlequin wrote: Morning everyone. I've read around the subject of searching and although using the FULLTEXT capability of MySQL might be the proper way of doing this I feel it's somewhat limited and have decided to use a simple select procedure. I'm sure there's a better way of doing this, as

Re: [PHP] how to concatenate php variables in mysql query

2004-09-22 Thread Daniel Kullik
[EMAIL PROTECTED] wrote: here is the whole query: $query = INSERT INTO inmarsat_comp SET date_added=NOW(), prefix='$prefix', firstname='$firstname', lastname='$lastname', job_title='$jobtitle', company_name='$company', no_of_employees='$employees',address_1='$address1',address_2='$address2',

Re: [PHP] how to concatenate php variables in mysql query

2004-09-22 Thread Daniel Kullik
Daniel Kullik wrote: [EMAIL PROTECTED] wrote: here is the whole query: $query = INSERT INTO inmarsat_comp SET date_added=NOW(), prefix='$prefix', firstname='$firstname', lastname='$lastname', job_title='$jobtitle', company_name='$company', no_of_employees='$employees',address_1='$address1

[PHP] Re: foreach()

2004-09-08 Thread Daniel Kullik
Anthony Ritter wrote: I get a: Warning: Invalid argument supplied for foreach() in c:\apache\htdocs\or_6.4.php on line 15 after submitting the form. Hello Anthony! As long as you don't submit the form with a single option selected there will be no $_POST['lunch'], therefore foreach() won't be

[PHP] Re: [PHP5] paradox ? Bug ?

2004-09-03 Thread Daniel Kullik
Hello Frédéric. This is neither a bug nor a paradox. The code you've posted just contains some nonsense. $foo['bar'] = 'bar'; cannot work since $foo is an object and not an array. And even $foo-bar = 'bar'; cannot work because there is no property $bar. Frédéric hardy wrote: Hello - I think

Re: [PHP] Re: [PHP5] paradox ? Bug ?

2004-09-03 Thread Daniel Kullik
(). And read http://www.php.net/~helly/php/ext/spl/index.html about arrayAccess. Php 5 allow you to overloading property dynamicaly with __set() and __get(). And you can access an object like an array with arrayAccess interface. There is no nonsense in my code. Fred. Daniel Kullik wrote: Hello

[PHP] Re: Usng Session Vaiable in WHERE Statement

2004-07-26 Thread Daniel Kullik
Hello again, Michael! You ought to read this: http://de.php.net/manual/en/language.types.string.php#language.types.string.parsing Daniel Harlequin wrote: Could someone please help me with my syntax here...? $MembersDataQry = SELECT * FROM MembersData WHERE UserID='$_SESSION['logname']'; I get an

Re: [PHP] 'echo' and 'html_decode'

2004-07-21 Thread Daniel Kullik
Matthew Sims wrote: I'm trying to use html_decode with the echo function but failed so far. ? echo mysql_result($product, 0,1) ? What would be the correct syntax? TIA You should read up on how to use mysql_result properly. Read through the user comments for tips.

Re: [PHP] Re: Mixing $_POST with text in a variable

2004-07-20 Thread Daniel Kullik
Skippy wrote: On Mon, 19 Jul 2004 14:15:09 -0400 Jason Barnett [EMAIL PROTECTED] wrote: Markus Stobbs wrote: $message = Name: $Name Division: $Division Phone: $Phone Email: $Email; ...but when I change $Name and the other variables to $_POST['Name'], I get this error: Parse error: parse error,

[PHP] Re: Parse Error, Unexpected $

2004-07-19 Thread Daniel Kullik
Hello. Cannot find any unexpected dollar-sign ($) in this code. But please enclose the associative array-indexes within quotation-marks and run your script again. [code] $foo = $_POST['assoc_index']; [/code] Daniel Harlequin wrote: I've checked my syntax but obviously missing something. Would

[PHP] Re: Stuffing those damn values into their fields...!

2004-07-19 Thread Daniel Kullik
Sounds pretty harsh, but Aidan is right. Another suggestion: Set error_reporting in your php.ini to E_ALL and display_errors to On. If you don't have access to the php.ini file you can try this: [code] error_reporting(E_ALL); ini_set('display_errors', true); [/code] Paste these two lines of code

Re: [PHP] track click throughs

2004-07-16 Thread Daniel Kullik
mysql_query() should return a boolean true if your insert-query works. Check that. [code] print (mysql_query('insert bla...')) ? '(-:' : ')-:'; die(); [/code] Cab wrote: Ed, Sorry it redirects now but on checking the database is no longer being updated? ?php

[PHP] Re: Trouble with include/require

2004-07-16 Thread Daniel Kullik
You should not overwrite the whole include-path. Just append new paths. This should do: [code] // Expand include-path (';' on Windows) $sep = ('WIN' == substr(PHP_OS, 0, 3)) ? ';' : ':'; ini_set('include_path', ini_get('include_path') . $sep . dirname(__FILE__) . 'includes/'); [/code] Daniel A.

Re: [PHP] Re: Trouble with include/require

2004-07-16 Thread Daniel Kullik
/db.inc', would work, since include_path is set to . in php.ini, but it does not. Any help? On Fri, 2004-07-16 at 10:35, Daniel Kullik wrote: You should not overwrite the whole include-path. Just append new paths. This should do: [code] // Expand include-path (';' on Windows) $sep = ('WIN' == substr

[PHP] Re: Getting the primary key from a MySQL insert

2004-07-16 Thread Daniel Kullik
Here you can find an overview of all existing MySQL functions in PHP: http://www.php.net/mysql And this is the function you are looking for: http://www.php.net/manual/en/function.mysql-insert-id.php And please take your time to look at this posting:

Re: [PHP] Re: Trouble with include/require

2004-07-16 Thread Daniel Kullik
, Daniel Kullik wrote: Does your PHP-interpreter parse .inc files at all? Did you get any error-messages? If not, set your error-reporting level to E_ALL any force PHP to display errors on screen. [code] error_reporting(E_ALL); ini_set('display_errors', true); [/code] Place this code before your

[PHP] Re: unset empty elements in an array

2004-07-12 Thread Daniel Kullik
Justin French wrote: Hi, Looking for a one-liner to delete all empty elements in an array. I know I can do it with a foreach loop, but I'm hoping that I've missed an existing function in the manual which may already do this, or a simple one-liner to replace the foreach. ?php foreach($in as $k

[PHP] Re: unset empty elements in an array

2004-07-12 Thread Daniel Kullik
Daniel Kullik wrote: Justin French wrote: Hi, Looking for a one-liner to delete all empty elements in an array. I know I can do it with a foreach loop, but I'm hoping that I've missed an existing function in the manual which may already do this, or a simple one-liner to replace the foreach

[PHP] Re: addslashes vs string unescape

2004-07-12 Thread Daniel Kullik
Skippy wrote: I'm confronted with a somewhat weird problem and hopefully someone can make a suggestion. I have to perform the following 3-step task: Step 1. Someone provides a string (let's call it the formatting string) which contains a PHP expression, which will apply a PHP function on another

[PHP] Re: Retrieving Data To Edit

2004-07-09 Thread Daniel Kullik
Harlequin wrote: This is really confusing and I'm sure very simple to achieve. I already have values selected that I want to open and edit: $sql = SELECT * FROM RegisteredMembers WHERE UserID='$_POST[TXT_UserID]'; I basically want to recall these values on screen for the user to edit themselves.

[PHP] Re: MySQL Database Connection Question

2004-07-08 Thread Daniel Kullik
Harlequin wrote: I have a user registration form that asks new users to register. However, Do I post the MySQLconnection string in the page they are completing or in the later page that the data is posted to, or both...? You ought to tell your registration-page to redirect to itself right after

Re: [PHP] Re: MySQL Database Connection Question

2004-07-08 Thread Daniel Kullik
Afan Pasalic wrote: July 6th? What are you talking about? Can you please give me more info about that? afan Daniel Kullik wrote: Note: You should checkout the thread 'Form Submission' started on July 6th since this is appearently not the best way to check if the user hit the submit-button

Re: [PHP] Re: MySQL Database Connection Question

2004-07-08 Thread Daniel Kullik
John Nichel wrote: Afan Pasalic wrote: Daniel Kullik wrote: Note: You should checkout the thread 'Form Submission' started on July 6th since this is appearently not the best way to check if the user hit the submit-button. Daniel July 6th? What are you talking about? Can you please give me more

Re: [PHP] Object is not instatiated on POST, Fatal error

2004-07-02 Thread Daniel Kullik
You might as well add a reference of your db-object to global scope. [code] $GLOBALS['_db_object'] = $db; [/code] Then you could access it anywhere in your code like this: [code] $GLOBALS['_db_object']-sumbitQuery($query); [/code] Daniel Angelo Binc2 wrote: Ok guys, I have fixed the problem and

[PHP] Re: Problem with session on first page loaded

2004-07-02 Thread Daniel Kullik
Source: http://www.php.net/set_cookie [snip] Once the cookies have been set, they can be accessed on the next page load with the $_COOKIE or $HTTP_COOKIE_VARS arrays. [/snip] Since PHP cannot access a cookie right after it has been set PHP cannot be sure if the cookie has been accepted on

[PHP] Re: Header or includes for one-level up access?

2004-07-02 Thread Daniel Kullik
Andre Dubuc wrote: Orginally when I designed my site, I put the db access file, conn.php, in the webarea - where all files reside. After reading a recent thread, I realize that this may not be too secure. Therefore, I would like to shove conn.php one level above the webarea. However, I don't

[PHP] Re: problem with embeded objects and reference

2004-07-01 Thread Daniel Kullik
Vincent Dupont wrote: Hi, could anyone help on this 'by reference' problem. I have 2 classes. The main class as a child class. The child class has properties (array) I would like to be able to manipulate the child's properties even after the child has been inserted into the main class. Does this

[PHP] Re: Session file problem?

2004-07-01 Thread Daniel Kullik
[EMAIL PROTECTED] wrote: Code I¹m using: session_cache_expire(0); session_cache_limiter('private'); setcookie(cookie,,0,/,iffinet.com,1); session_start(); I use session_destroy(); in the logout function but the /tmp/sess_* file does not get deleted. Also the cookie doesn¹t go away even though it

[PHP] Re: Error Reporting

2004-06-28 Thread Daniel Kullik
Tom Chubb wrote: I ave a strange problem with my error reporting! I have set php.ini to: error_reporting = E_ALL but I don't see any errors. (After I was happy things were working on my Apache Test Server, I uploaded to my web host and discovered errors.) Thanks, Tom Make sure that

[PHP] Re: session_is_registered gets session values only after doing some output first !?

2004-06-23 Thread Daniel Kullik
Frank Rust wrote: I try to check if a session is registered. This works fine if I first do some output echo abc; if (!session_is_registered('userid')) { do_something(); } else { redirect_to_somewhere(); } and I can't redirect to another page ... If I comment out the echo statement I get