Friday, 19 January 2007
|
| Conditional Select Dan Shirah 23:33:46 |
| | I have a page that shows all outstanding tickets, what I'm trying to have it do is let users search by several categories. I want to be able to filter the results based on the user input.
For instance, say I have an employee that wants to find ticket #2. He enters "2" in the Request ID field and also enters "01/01/06" in the Date Requested field. How would I return the ticket that matches both Request ID and Date Requested fields? I have been able to return a result with only 1 search criteria entered, but get no results with more than 1.
Below is the code I am working on.
else { /* if the "submit" variable exists, the form has been submitted - look for and process form data */ // display result $request_id = $_POST['request_id']; $date_entered = $_POST['date_entered']; $status = $_POST['status']; $request_type = $_POST['request_type'];
?> <form name="submitForm" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <table align="center" width="780" cellpadding="2" cellspacing="2" border="0"> <tr> <td width="185" align="right"><span class="smallbold">Request Id:</span></td> <td width="128" class="tblcell"><input type="Text" value="<?php echo $_POST['request_id']; ?>" name="request_id" size="8" maxlength=""></td> <td width="187" align="right"><span class="smallbold">Date Entered:</span></td> <td width="254" class="tblcell"><input type="Text" value="<?php echo $_POST['date_entered']; ?>" name="date_entered" size="15" maxlength=""></td> </tr> <tr>
<td width="185" height="27" align="right"><span class="smallbold">Status:</span></td> <td width="128" class="tblcell"><input type="Text" value="<?php echo $_POST['status']; ?>" name="status" size="8" maxlength=""></td> <td width="187" align="right"><span class="smallbold">Request Type:</span></td> <td width="254" class="tblcell"><input type="Text" value="<?php echo $_POST['request_type']; ?>" name="request_type" size="15" maxlength=""></td> </tr> </table> <FORM ACTION="a href="javascript:clearForm()" METHOD="POST" name="logoutform"> <table align="center" border="0" cellpadding="0" cellspacing="0" width="780"> <tr> <td colspan="2"> <input type="submit" name="submit" value="Search">  <input type="submit" name="reset" value="Reset"> </td> </tr> </table> <table align="center" border="0" cellpadding="0" cellspacing="0" width="780"> <tr><td> </td></tr> <tr> <td height="13" align="center" class="tblhead"><div align="center"><strong>Process Payments </strong></div></td> </tr> <tr> <td colspan="6"><hr color="#006600" /></td> </tr> </table> <table align="center" border="0" cellpadding="0" cellspacing="0" width="780"> <tr> <td width="88" height="13" align="center" class="tblhead"><div align="center">Request ID </div></td> <td width="224" height="13" align="center" class="tblhead"><div align="center">Date/Time Entered </div></td> <td width="156" height="13" align="center" class="tblhead"><div align="center">Status</div></td> <td width="156" height="13" align="center" class="tblhead"><div align="center">Request Type </div></td> <td width="156" height="13" align="center" class="tblhead"><div align="center">Last Processed By</div></td> </tr> </table> <?php $database = "database"; $host = "host"; $user = "username"; $pass = "password"; // Connect to the datbase $connection = mssql_connect($host, $user, $pass) or die ('server connection failed'); $database = mssql_select_db("$database", $connection) or die ('DB selection failed'); // Query the table and load all of the records into an array.
**Note my SQL statement below, can I break in and out of PHP like this to verify if multiple variables are set?* * $sql = "SELECT child_support_payment_request.credit_card_id, credit_card_payment_request.credit_card_id, date_request_received FROM child_support_payment_request, credit_card_payment_request WHERE child_support_payment_request.credit_card_id = credit_card_payment_request.credit_card_id" ?> <?php if ($request_id !== '') { "AND credit_card_payment_request.credit_card_id = $request_id" } ?> <?php if ($dateTime !== '') { "AND date_request_received = $dateTime"; } ?> <?php $result = mssql_query($sql) or die(mssql_error()); echo "<table width='780' border='1' align='center' cellpadding='2' cellspacing='2' bordercolor='#000000'>";
while ($row = mssql_fetch_array($result)) { $id = $row['credit_card_id']; $dateTime = $row['date_request_received']; echo "<tr>"; echo "<td width='88' height='13' align='center' class='tblcell'><div align='center'>$id</div></td>"; echo "<td width='224' height='13' align='center' class='tblcell'><div align='center'>$dateTime</div></td>"; echo "<td width='156' height='13' align='center' class='tblcell'><div align='center'>Open</div></td>"; echo "<td width='156' height='13' align='center' class='tblcell'><div align='center'>Payment Type</div></td>"; echo "<td width='156' height='13' align='center' class='tblcell'><div align='center'>Last Processed By</div></td>"; echo "</tr>"; } echo "</table>"; ?> <?php } ?>
|
| | 1 answer | Add comment |
|
| What makes a PHP expert H 22:16:27 |
| | Dear All
I often see job ads asking for a PHP expert and was wandering what you all thought makes a PHP programmer into an expert.
what would you mark out as the key skills that distinguishes an expert from the ordinary i.e. OOP mastery, regular expressions etc.
p.s. I am not an expert but am intersted to see if i could become one!
|
| | 9 answers | Add comment |
|
| [PHP-DEV] CVS Account Request: jamek6 David Jamka 22:01:59 |
| | For Translating the documentation
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
|
| | Add comment |
|
| Beginner Question Rob 21:50:33 |
| | I am a newcomer to PHP and I am looking for an intsallation package similar to to FoxPro for MAC OSX 10.2.(Ie intsall appache, MY SQL and Latest version of PHP) Does anyone know where I may find one? Thanks RB
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 22 answer | Add comment |
|
| [PHP-DEV] Some questions about PHP Dev. from an open source perspective Kin Lau 20:44:14 |
| | Hi there,
My name is Kin Lau and I'm doing some study on open source projects. I would like to take a look at PHP, but I'm having some difficulties finding the all the information the web. I'd be much obliged if anyone could provide any extra information on the questions/aspects for PHP below. Just whatever you know for any of them, don't have to answer all of them:
Questions: -How do decision processes work in os projects? Is this also open to the whole community? -How is QA/testing done and why is it effective? (reputation in os is an important aspect) -How is reusability working and why is it so effective in open source? -What are the incentives for developers in os development?
Aspects: -Structure of development team (hierarchy) -Distribution of development team -Type of developers -> Employed? Students? Other individuals? -Defect tracking -QA -Requirements -Documentation -Reviews -Transparency -Planning (versions, etc.. stable/unstable) -Communication style/tools -Change tracking -Tools (web sites, builds, change management, newsgroups, forums, etc..) -How successful is the feedback loop (contributions from outside core team/company contributions)
Thank you very much for your time!
Sincerely, - Kin
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
|
| | Add comment |
|
| PHP5 Cross Compilation Kiran Malla 20:16:55 |
| | Hello,
I am trying to cross compile PHP-5.2.0 for arm linux.
# export CC=/usr/local/arm/3.3.2/bin/arm-linux-gcc # export AR=/usr/local/arm/3.3.2/bin/arm-linux-ar # export LD=/usr/local/arm/3.3.2/bin/arm-linux-ld # export NM=/usr/local/arm/3.3.2/bin/arm-linux-nm # export RANLIB=/usr/local/arm/3.3.2/bin/arm-linux-ranlib # export STRIP=/usr/local/arm/3.3.2/bin/arm-linux-strip
# ./configure --host=arm-linux --sysconfdir=/etc/appWeb --with-exec-dir=/etc/appWeb/exec
Result of this configure is,
Checking for iconv support... yes checking for iconv... no checking for libiconv... no checking for libiconv in -liconv... no checking for iconv in -liconv... no configure: error: Please reinstall the iconv library.
I have installed libiconv-1.11 on my system. The command 'which iconv' shows '/usr/local/bin/iconv'. I have no clue why configure is failing due to missing iconv.
Somebody please throw some light on this issue.
Regards, Kiran
|
| | 3 answer | Add comment |
|
| exchange server connection problem Runner60 19:00:15 |
| | Strange behaviour: using same script with php.exe and php-win.exe (cli) give different result in connecting to an exchange server. Using phpmailer class it is generated a "$Language string failed to load: connect_host" error. I tried using mail() php function and problem still exist, so this is not a phpmailer class problem. I've assured using same php.ini, tried to ini_set() relevant settings in script, but php.exe connects and php-win.exe doesn't. Any clues?? Thanks.
Davide
-- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | Add comment |
|
| webservice libraries/frameworks Blackwater Dev 18:08:51 |
| | I've heard that there might be a php library or framework that allows you to expose your code as a webservice with little to no extra code. I heard the code could potentially also allow access via several different protocols.
Has anyone come across anything similar, or do I need to pick a specific protocol for my services?
Thanks!
|
| | Add comment |
|
| [PHP-DEV] CVS Account Request: tkli Tom Klingenberg 17:57:24 |
| | I'd like to maintain my code via CVS and I do not have a CVS repository somewhere else (this is related to a PEAR Package).
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 1 answer | Add comment |
|
| Displaying Results on different rows in tables Dan Shirah 16:24:38 |
| | Hello all,
I am trying to pull data and then loop through the multiple results display in seperate rows. My database contains several tables which are all tied together by the credit_card_id. After running the query, it ties the unique record together by matching the credit_card_id in both tables. How would I go about displaying the results of this query in a table with a single row for each unique record?
Each row of the result will have 5 columns: Request ID, Date/Time Entered, Status, Payment Type, Last Processed By.
If I assign the results of the query to variables (Such as $id = $row['credit_card_id'];) how would I display that data?
Would it be something like this:
foreach($row as $data) { echo "<table> <tr> <td><a href=$item->link>$id</a></td> </tr>"; echo "<tr> <td>$dateTime</td> </tr> </table>"; echo "<tr> <td>$Status</td> </tr> </table>";
} Below is the code I have so far.
<?php $database = "database"; $host = "host"; $user = "username"; $pass = "password"; // Connect to the datbase $connection = mssql_connect($host, $user, $pass) or die ('server connection failed'); $database = mssql_select_db("$database", $connection) or die ('DB selection failed'); // Query the table and load all of the records into an array. $sql = "SELECT child_support_payment_request.credit_card_id, credit_card_payment_request.credit_card_id, date_request_received FROM child_support_payment_request, credit_card_payment_request WHERE child_support_payment_request.credit_card_id = credit_card_payment_request.credit_card_id"; $result = mssql_query($sql) or die(mssql_error()); while ($row=mssql_fetch_array($result)); $id = $row['credit_card_id']; $dateTime = $row['date_request_received'];
?>
|
| | 4 answer | Add comment |
|
| FOCUS-IN-EVENT FOCUS-OUT-EVENT RUN WELL AngeloP 14:41:59 |
| | Here an examle
<?php // display popup alert box function alert($msg) { $dialog = new GtkDialog('Alert', null, Gtk::DIALOG_MODAL); $dialog->set_position(Gtk::WIN_POS_CENTER_ALWAYS); $top_area = $dialog->vbox; $top_area->pack_start($hbox = new GtkHBox()); // note 3 $stock = GtkImage::new_from_stock(Gtk::STOCK_DIALOG_WARNING, Gtk::ICON_SIZE_DIALOG); $hbox->pack_start($stock, 0, 0); $hbox->pack_start(new GtkLabel($msg)); $dialog->add_button(Gtk::STOCK_OK, Gtk::RESPONSE_OK); $dialog->set_has_separator(false); $dialog->show_all(); $dialog->run(); $dialog->destroy(); } // Write something into status bar function Status_Message($msg){ $context_id = $GLOBALS["status"] ->get_context_id('...'); $GLOBALS["status"]->push($context_id, $msg); }
// ========================================================= $window = new GtkWindow(); $window->set_size_request(400, 150); $window->connect_simple('destroy', array('Gtk','main_quit'));
$window->add($vbox = new GtkVBox()); $window->add_events(Gdk::FOCUS_CHANGE);
// display title $title = new GtkLabel("Focus in Out tab from one to other field"); $title->modify_font(new PangoFontDescription("Times New Roman Italic 10")); $title->modify_fg(Gtk::STATE_NORMAL, GdkColor::parse("#0000ff")); $title->set_size_request(-1, 40); $vbox->pack_start($title, 0, 0);
$name = new GtkEntry(); $name->connect_after('focus-in-event', 'on_focus_in_name'); $name->connect_after('focus-out-event', 'on_focus_out_name'); $vbox->pack_start($name, 0, 0);
$surname = new GtkEntry(); $surname->connect_after('focus-in-event', 'on_focus_in_surname'); $surname->connect_after('focus-out-event', 'on_focus_out_surname'); $vbox->pack_start($surname, 0, 0);
$status = new GtkStatusbar(); $vbox->pack_start($status, 1, 1);
// check user input function on_focus_in_name($widget) { Status_Message('I get into the name...'); print "Test focus in name\n"; return false; }
// check user input function on_focus_out_name($widget) { alert ("focus is out name"); print "Test focus out name\n"; return false; }
// check user input function on_focus_in_surname($widget) { Status_Message('I get into the suname...'); print "Test focus in suname\n"; return false; }
// check user input function on_focus_out_surname($widget) { alert ("focus is out surname.\nWait please I crash!!!"); print "Test focus out surname\n"; return false; }
$window->show_all(); Gtk::main(); ?> -- View this message in context: http://www.nabble.com/FOCUS-IN-EVENT-FOCUS-OUT-EVENT-RUN-WELL-tf3039452.html#a8447704 Sent from the Php - GTK - General mailing list archive at Nabble.com.
-- PHP-GTK General Mailing List (http://gtk.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | Add comment |
|
| Month display calendar Denis L. Menezes 12:55:44 |
| | Dear friends.
Can anyone please show me calendar scripts to make a calendar with a monthly display as shown in http://www.easyphpcalendar.com/ ?
Thanks Denis
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 2 answer | Add comment |
|
| what do i need to disable Don 11:51:57 |
| | Ok,
You have been very helpful with my questions so far and I thank you for that.
My next task is disable harmful tags/scripts in a full text field.
I want to store a bio type field and I am considering allowing html (to allow a myspace type of customization to the page), but I am really new to this so I really don't know what kind of trouble I am asking for.
I'm sure that I need to block JavaScript, but are there other things (tags, scripting, etc.) that can be input into my DB that will cause problems either being stored as such or when accessed?
Again, thanks for the advice in advance.
Don
|
| | 1 answer | Add comment |
|
| [PHP-DEV] [RFC] Help debugging overloaded objects Marcus Boerger 11:29:26 |
| | Hello internals,
the attached patch introduces a new handler to the engine that is supposed to help debugging overloaded objects. It allows to return a temporary hash rather then the object properties. This way an extension can show non properties in var_dump() and print_r(). It will be used in extensions like SimpleXML. To show how it will look like the changes for said extension are alsopresent. Last but not least the handler can be NULL in which case the old behavior is maintained. If noone objects I will commit this by the end of the week.
Any comments?
Best regards, Marcus
Index: Zend/zend.c =================================================================== RCS file: /repository/ZendEngine2/zend.c,v retrieving revision 1.391 diff -u -p -d -r1.391 zend.c --- Zend/zend.c12 Jan 2007 14:38:07 -00001.391 +++ Zend/zend.c15 Jan 2007 22:23:16 -0000 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend.c,v 1.391 2007/01/12 14:38:07 dmitry Exp $ */ +/* $Id: zend.c,v 1.390 2007/01/11 16:47:46 dmitry Exp $ */ #include "zend.h" #include "zend_extensions.h" @@ -581,6 +581,7 @@ ZEND_API void zend_print_zval_r_ex(zend_ HashTable *properties = NULL; zstr class_name = NULL_ZSTR; zend_uint clen; +int is_temp; if (Z_OBJ_HANDLER_P(expr, get_class_name)) { Z_OBJ_HANDLER_P(expr, get_class_name)(expr, &class_name, &clen, 0 TSRMLS_CC); @@ -593,8 +594,11 @@ ZEND_API void zend_print_zval_r_ex(zend_ if (class_name.v) { efree(class_name.v); } -if (Z_OBJ_HANDLER_P(expr, get_properties)) { +if (Z_OBJ_HANDLER_P(expr, get_debug_info)) { +properties = Z_OBJ_HANDLER_P(expr, get_debug_info)(expr, &is_temp TSRMLS_CC); +} else if (Z_OBJ_HANDLER_P(expr, get_properties)) { properties = Z_OBJPROP_P(expr); +is_temp = 0; } if (properties) { if (++properties->nApplyCount>1) { @@ -604,6 +608,10 @@ ZEND_API void zend_print_zval_r_ex(zend_ } print_hash(properties, indent, 1 TSRMLS_CC); properties->nApplyCount--; +if (is_temp) { +zend_hash_destroy(properties); +efree(properties); +} } break; } Index: Zend/zend_object_handlers.c =================================================================== RCS file: /repository/ZendEngine2/zend_object_handlers.c,v retrieving revision 1.182 diff -u -p -d -r1.182 zend_object_handlers.c --- Zend/zend_object_handlers.c10 Jan 2007 15:59:55 -00001.182 +++ Zend/zend_object_handlers.c15 Jan 2007 22:23:17 -0000 @@ -49,13 +49,19 @@ called, we cal __call handler. */ -static HashTable *zend_std_get_properties(zval *object TSRMLS_DC) +ZEND_API HashTable *zend_std_get_properties(zval *object TSRMLS_DC) { zend_object *zobj; zobj = Z_OBJ_P(object); return zobj->properties; } +ZEND_API HashTable *zend_std_get_debug_info(zval *object, int *is_temp TSRMLS_DC) +{ +*is_temp = 0; +return zend_std_get_properties(object TSRMLS_CC); +} + static zval *zend_std_call_getter(zval *object, zval *member TSRMLS_DC) { zval *retval = NULL; @@ -1186,6 +1192,7 @@ ZEND_API zend_object_handlers std_object zend_std_compare_objects,/* compare_objects */ zend_std_cast_object_tostring,/* cast_object */ NULL,/* count_elements */ +NULL, /* get_debug_info */ }; /* Index: Zend/zend_object_handlers.h =================================================================== RCS file: /repository/ZendEngine2/zend_object_handlers.h,v retrieving revision 1.61 diff -u -p -d -r1.61 zend_object_handlers.h --- Zend/zend_object_handlers.h1 Jan 2007 09:29:21 -00001.61 +++ Zend/zend_object_handlers.h15 Jan 2007 22:23:17 -0000 @@ -80,6 +80,8 @@ typedef void (*zend_object_unset_dimensi /* Used to get hash of the properties of the object, as hash of zval's */ typedef HashTable *(*zend_object_get_properties_t)(zval *object TSRMLS_DC); +typedef HashTable *(*zend_object_get_debug_info_t)(zval *object, int *is_temp TSRMLS_DC); + /* Used to call methods */ /* args on stack! */ /* Andi - E fbc) (function being called) needs to be initialized already in the INIT fcall opcode so that the parameters can be parsed the right way. We need to add another callback for this. @@ -132,6 +134,7 @@ struct _zend_object_handlers { zend_object_compare_tcompare_objects; zend_object_cast_tcast_object; zend_object_count_elements_tcount_elements; +zend_object_get_debug_info_tget_debug_info; }; extern ZEND_API zend_object_handlers std_object_handlers; @@ -142,7 +145,8 @@ ZEND_API zval **zend_std_get_static_prop ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, zend_uchar type, zstr property_name, int property_name_len TSRMLS_DC); ZEND_API union _zend_function *zend_std_get_constructor(zval *object TSRMLS_DC); ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce, zval *member, int silent TSRMLS_DC); - +ZEND_API HashTable *zend_std_get_properties(zval *object TSRMLS_DC); +ZEND_API HashTable *zend_std_get_debug_info(zval *object, int *is_temp TSRMLS_DC); ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int type, void *extra TSRMLS_DC); Index: ext/simplexml/simplexml.c =================================================================== RCS file: /repository/php-src/ext/simplexml/simplexml.c,v retrieving revision 1.226 diff -u -p -d -r1.226 simplexml.c --- ext/simplexml/simplexml.c1 Jan 2007 09:29:29 -00001.226 +++ ext/simplexml/simplexml.c15 Jan 2007 22:23:18 -0000 @@ -615,6 +615,7 @@ static void sxe_dimension_write(zval *ob } /* }}} */ +#if HELLY_0 static zval** sxe_property_get_adr(zval *object, zval *member TSRMLS_DC) /* {{{ */ { php_sxe_object *sxe; @@ -639,12 +640,16 @@ static zval** sxe_property_get_adr(zval _node_as_zval(sxe, node, return_value, type, name, sxe->iter.nsprefix, sxe->iter.isprefix TSRMLS_CC); sxe = php_sxe_fetch_object(return_value TSRMLS_CC); +if (sxe->tmp) { +zval_ptr_dtor(&sxe->tmp); +} sxe->tmp = return_value; return_value->is_ref = 1; return &sxe->tmp; } /* }}} */ +#endif /* {{{ sxe_prop_dim_exists() */ @@ -946,9 +951,7 @@ static void sxe_properties_add(HashTable } } -/* {{{ sxe_properties_get() - */ -static HashTable * sxe_properties_get(zval *object TSRMLS_DC) +static HashTable * sxe_get_prop_hash(zval *object, int is_debug TSRMLS_DC) /* {{{ */ { zval *value; zval *zattr; @@ -962,7 +965,10 @@ static HashTable * sxe_properties_get(zv sxe = php_sxe_fetch_object(object TSRMLS_CC); -if (sxe->properties) { +if (is_debug) { +ALLOC_HASHTABLE(rv); +zend_u_hash_init(rv, 0, NULL, ZVAL_PTR_DTOR, 0, UG(unicode)); +} else if (sxe->properties) { zend_hash_clean(sxe->properties); rv = sxe->properties; } else { @@ -975,7 +981,7 @@ static HashTable * sxe_properties_get(zv if (!node) { return rv; } -if (1||sxe->iter.type != SXE_ITER_CHILD) { +if (is_debug) { if (sxe->iter.type == SXE_ITER_ELEMENT) { node = php_sxe_get_first_node(sxe, node TSRMLS_CC); } @@ -1066,6 +1072,19 @@ next_iter: } /* }}} */ +static HashTable * sxe_get_properties(zval *object TSRMLS_DC) /* {{{ */ +{ +return sxe_get_prop_hash(object, 0 TSRMLS_CC); +} +/* }}} */ + +static HashTable * sxe_get_debug_info(zval *object, int *is_temp TSRMLS_DC) /* {{{ */ +{ +*is_temp = 1; +return sxe_get_prop_hash(object, 1 TSRMLS_CC); +} +/* }}} */ + static int sxe_objects_compare(zval *object1, zval *object2 TSRMLS_DC) /* {{{ */ { php_sxe_object *sxe1; @@ -1657,16 +1676,20 @@ static int cast_object(zval *object, int static int sxe_object_cast(zval *readobj, zval *writeobj, int type, void *extra TSRMLS_DC) { php_sxe_object *sxe; -xmlChar *contents = NULL; +xmlChar *contents = NULL; xmlNodePtr node; -int rv; +int rv; +HashTable *prop_hash; sxe = php_sxe_fetch_object(readobj TSRMLS_CC); if (type == IS_BOOL) { node = php_sxe_get_first_node(sxe, NULL TSRMLS_CC); +prop_hash = sxe_get_prop_hash(readobj, 1 TSRMLS_CC); INIT_PZVAL(writeobj); -ZVAL_BOOL(writeobj, node != NULL || zend_hash_num_elements(sxe_properties_get(readobj TSRMLS_CC)) > 0); +ZVAL_BOOL(writeobj, node != NULL || zend_hash_num_elements(prop_hash) > 0); +zend_hash_destroy(prop_hash); +efree(prop_hash); return SUCCESS; } @@ -1749,14 +1772,14 @@ static zend_object_handlers sxe_object_h sxe_property_write, sxe_dimension_read, sxe_dimension_write, -sxe_property_get_adr, +NULL, sxe_get_value,/* get */ NULL, sxe_property_exists, sxe_property_delete, sxe_dimension_exists, sxe_dimension_delete, -sxe_properties_get, +sxe_get_properties, NULL, /* zend_get_std_object_handlers()->get_method,*/ NULL, /* zend_get_std_object_handlers()->call_method,*/ NULL, /* zend_get_std_object_handlers()->get_constructor, */ @@ -1764,7 +1787,8 @@ static zend_object_handlers sxe_object_h NULL, /* zend_get_std_object_handlers()->get_class_name,*/ sxe_objects_compare, sxe_object_cast, -sxe_count_elements +sxe_count_elements, +sxe_get_debug_info }; /* {{{ sxe_object_clone() Index: ext/standard/var.c =================================================================== RCS file: /repository/php-src/ext/standard/var.c,v retrieving revision 1.259 diff -u -p -d -r1.259 var.c --- ext/standard/var.c1 Jan 2007 09:29:32 -00001.259 +++ ext/standard/var.c15 Jan 2007 22:23:18 -0000 @@ -181,6 +181,7 @@ PHPAPI void php_var_dump(zval **struc, i zstr class_name; zend_uint class_name_len; int (*php_element_dump_func)(zval**, int, va_list, zend_hash_key*); +int is_temp; if (level > 1) { php_printf("%*c", level - 1, ' '); @@ -217,9 +218,10 @@ PHPAPI void php_var_dump(zval **struc, i } php_printf("%sarray(%d) {\n", COMMON, zend_hash_num_elements(myht)); php_element_dump_func = php_array_element_dump; +is_temp = 0; goto head_done; case IS_OBJECT: -myht = Z_OBJPROP_PP(struc); +myht = Z_OBJ_HANDLER_PP(struc, get_debug_info)(*struc, &is_temp TSRMLS_CC); if (myht && myht->nApplyCount > 1) { PUTS("*RECURSION*\n"); return; @@ -237,6 +239,10 @@ head_done: php_printf("%*c", level-1, ' '); } PUTS("}\n"); +if (is_temp) { +zend_hash_destroy(myht); +efree(myht); +} break; case IS_RESOURCE: { char *type_name;
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php |
| | 8 answers | Add comment |
|
| File not found error Alex Keim 10:19:46 |
| | I can't figure out how to fix the file not found error that I'm getting. "... failed to open stream: No such file or directory..." I've looked for answers all over the net and can't find anything that seems to help. Basically I only get the error when using relative paths. My PHP include_path is set to ".;c:\php\includes". Absolute paths work just fine. I know my PHP is at least mostly configured correctly. I say mostly because I run Gallery (which uses PHP) on my server and it works just fine but I cann't run either phpBB2 or MediaWiki because they use relative paths for includes. phpBB2 does work when I change relative to absolute but I don't want to go through and edit ever single file... plus upgrades will be a pain. So anyone run into this problem and solve it? Thanks. - Alex
some phpinfo: PHP Version 5.2.0RC3-dev Build Date Aug 31 2006 20:16:01 Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--with-gd=shared" Server API Apache 2.0 Filter Virtual Directory Support enabled Configuration File (php.ini) Path C:\php\php.ini PHP API 20041225 PHP Extension 20060613 include_path .;c:\php\includes .;c:\php\includes
-- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 4 answer | Add comment |
|
| Question about session Bagus Nugroho 09:31:14 |
| | I have session code which written WindowsXP and It wotk properly as expected, but when I'm used in Windows 2K, it got error as; Notice: Undefined index: loginMessage in C:\CentralData\forms\mainForm.php on line 65 I'am used Apache 2.0 and PHP 5.0.4. Is php.ini setting on W2K different with XP
Thxs in advance bgs <!-- .style1 {font-weight: bold} .style2 { font-size: 24px; font-weight: bold; } .style8 {color: #0066CC; font-weight: bold; font-size: 18px; } -->
|
| | 6 answers | Add comment |
|
| Oracle Execute Function Brad Bonkoski 05:53:19 |
| | Hello All,
I have this Oracle function, and within my code I call it like this:
$sql = "BEGIN :result := my_funtion_name('$parm1', $parm2, null, null, null); END;"; $stmt = $db->parse($sql); $rc = null; ocibindbyname($stmt, ":result", &$rc); $db->execute($stmt, $sql);
The problem is that the execute function spits back an error/warning message, but the Oracle function properly executes and the data is in the Database. The execute function looks like this: (This function enters the conditional where ii executes the die() function)
public function execute($stmt, $query = "") { if( $this->trans) $result = @ociexecute($stmt, OCI_DEFAULT); else $result = @ociexecute($stmt); if (!$result ) { $error = ocierror($this->link); $this->report('Invalid Statement: ' . $stmt .'('.$query.')'. ' ' . htmlentities($error['message'])); die('Invalid Statement: ' . $stmt .'('.$query.')'. ' ' . htmlentities($error['message'])); } return $result; }
I use this wrapper class for many things, and the execute function for many things, without any problems. Now, this is an initial run at calling Oracle functions within PHP. Any words of wisdom as to what could be causing this problem, or any other insight?
TIA -Brad
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 4 answer | Add comment |
|
| Storing dynamic attribute data in a db Chris W. Parker 04:34:17 |
| | Hello,
This is now my 3rd attempt at writing this email. The first two were pretty long... I'm currently working on trying to find a solution that is both simple and flexible for storing the data of a complicated set of dynamic options for some of our products. My current thinking is that I will use Modified Preorder Tree Traversal to organize the data. Each record will have the following: id (auto-number) sku (related product's sku) lft (hierarchy data) rgt (hierarchy data) attribute (like: Size, Color, Style) option (like: Blue, Large, Plain) pricemodifier (-$20, +$20)
This kind of data is not difficult to handle if every combination that is available through the different options is actually available from the manufacturer. However, some combinations are not possible so the data needs to represent itself that way. For example, all t-shirts come in Red, Green, or Blue but only Green shirts come in Large. All other colors have only Small and Medium.
Is there a standard way to handle this kind of thing if not, how would you handle it?
(On a side note, when the solution is found, could it be called a "pattern"?)
Thanks, Chris.
p.s. Yes this is the short email.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 4 answer | Add comment |
|
| [PHP-DEV] Im back Jason Greene 00:39:11 |
| | All,
I am sure many of you have noticed that I haven't been around for about the last 6 months. This was mainly due to a large amount of commitment required for a large project by my employer, and other events in my life that limited my free time.
I will be catching back up in the next few weeks, and my first goal is to finish off the sockets and pcntl documentation (Should take about 2 weeks).
If anyone has any questions, feel free to email me.
Thanks, -Jason
-- Jason Greene <jason@inetgurus.net> <jason@php.net>
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 42 answer | Add comment |
|
| Re: Problem with focus-in or focus-out event and GtkDialog Anant Narayanan 00:39:11 |
| | Hi Angelo,
all run well if I add a comment to alert //alert> so I thik the problem is in GtkDialog> Anyone has an idea about it? The problem seems to be with $dialog->destroy(); Although the dialog is destroyed the program segfaults as soon as the function returns.
As a temporary solution; use $dialog->hide_all() instead of destroy(); and store the dialog widget in a global variable or something to avoid recreating it everytime. Just change the attributes and show it when you need it again on the next event.
Also, I suggest you use the GtkMessageDialog widget rather than just GtkDialog; it seems to suit your purpose.
-- Anant
-- PHP-GTK General Mailing List (http://gtk.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 3 answer | Add comment |
|
| Include files beneath pointed directory Wikus Moller 00:39:11 |
| | Hi.
I have a windows server and I know this issue has been dealt with before but I can't find it, I want to include a file from a directory beneath or aside my home directory.
Can I use the C:\directory\anotherdirectory\file.php in the include function like include "C:\directory\anotherdirectory\file.php"; or do I need more code to make it work? I am sure I do. The directory would be aside my home directory.
Thanks
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 1 answer | Add comment |
|
| Scope of include Jekillen 00:12:07 |
| | Hello php list: If I include a php script inside a php function definition and then call the function in another script. What is the scope of variables in the included script? Are they local to the function that calls include with the file name? Thanks in advance; I'm not sure where to look for this answer; JK
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 6 answers | Add comment |
Thursday, 18 January 2007
|
| Daylight Savings Time in PHP4 Mike Caplin 23:01:58 |
| | Does anyone know if the change in Daylight Savings Time (March this year) affects PHP v4.x? I looked around www.php.net and all I could find was a reference to v5 (http://bugs.php.net/bug.php?id=35296). Is there a v4 release which is compatible with the DST change? Or even a patch could be applied?
Thanks.
Mike
|
| | 1 answer | Add comment |
|
| [PHP-DEV] CVS Account Request: cbaughman Christopher Baughman 20:37:27 |
| | I would like to help maintain documentation, I have noticed many unanswered bugs, and have time to contribute to a project I have come to enjoy. I would also like to possibly help with developing the runtime.
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 2 answer | Add comment |
|