Hi guys, sometimes i need to insert into the table some null values, or update them setting the value to NULL.
I've read somewhere in the postgresql documentation that this cant be done, but can be tricket with the default value:
pg_query("INSERT INTO my_table (col_a, col_b) VALUES ('whatever', default)
p.s: i know that in this examp...
function procLogin($user,$pass,$remember){
global $session, $form;
$retval = $session->login($user, $pass ,$remember);
if($retval){
header("Location: ".$session->referrer);
echo "comign in";
return 'yes';
}else{
$_SESSION['value_array'] = $_POST;
$_SESSION['error_array'] = $for...
Recently I stumbled on an interesting bug where entries would show up in our local custom-made ticket system from users that didn't exist in the app. After some poking around I realised that both this and another PHP app running on the same server were using $_SESSION['user'] for authentication purposes. When someone used one system and ...
Well here is the API I'm trying to use: http://www.hotelscombined.com/api/LiveRates.asmx?op=HotelSearch
Here is the code I've tried:
$client = new SoapClient('http://www.hotelscombined.com/api/LiveRates.asmx?WSDL');
echo '<pre>'; var_dump($client->__getFunctions()); echo '</pre><br /><br /><br />';
//since the above line returns the ...
I have a component that calls a template from the template folder as it should be done. But as there are a lot of files in the template folder i would rather have them split up in different sub folders.
Is it possible to call a template in a specific folder for a component? And how is this done?
now i have public function executeTest(){...
A friend was showing me a API made with a COM Object and a SOAP interface. He showed me it worked in php in windows but I have serious doubts if it is achievable in linux or any other non-windows OS. Thanks!
...
Can someone suggest that out of the two mentioned (odd?) combinations, which is less odd, or in other words, is less trouble to work with + maintain.
If it helps, the system is going to have two front-ends - one web application and one desktop application. The desktop application is going to be coded using VB.NET, and the web applicatio...
I am having a problem in my php. What I'm trying to do here is, that I have a .html which directs to an external .js and this js file open up a .php
The php extracts data from mysql tables and xml and displays the data on the webpage, (in .html form as table rows). Now when a user clicks on any row, I want that php should open up a new ...
Which SMTP server should I use, when develop im my PC?
I currently use mercury,
just because it's come with XAMPP.
but mercury is too difficult for me.
because it has too much settings.
so I am seeking more easy to use
SMTP soft.
is there any easy SMTP soft there?
...
My particular scenario involves doing some text transformation using regular expressions within a private method. The private method calls preg_replace_callback, but is seems that callbacks need to be public on objects, so I'm stuck breaking out of the private world and exposing implementation details when I'd rather not.
So, in a nutsh...
So I am trying to Sync a bunch of Videos I've retrieved from a particular user from Youtube to a database table of Video Ids.
This is because YouTube does not allow the adding of meta information to a video. Hence I've created a video table on my server and would like to sync up videoids.
i.e. php/mysql app <-> youtube
The datastructu...
Problem:
I'm trying to code a multiple choice quiz for my fellow students -and primarily to aid my own learning- and so I'm creating a multiple choice web-based quiz using PHP (5.2.08) and MySQL (5.0.32)
The questions table is:
+----------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key |...
Why is this the extended ascii character (â, é, etc) getting replaced with <?> characters?
I attached a pic... but I am using PHP to pull the data from MySQL, and some of these locations have extended characters... I am using the Font Arial.
You can see the screen shot here: http://img269.imageshack.us/i/funnychar.png/
Still happening...
What is the code to show how long it took for PHP to process a page?
Also, how many sql queries were performed to generate that page?
...
In php, I have a string like this:
$string = "[email protected] MIME-Version: bla bla bla";
How do i get the email address only? Is there any easy way to get the value??
EDIT:
THANKS guys. Using regular expression solved my problem. You guys are the BEST!!
...
Is there a function in PHP to go out to a separate URL and insert whats returned
into the page? The include() function is only for local files right? Would
I have to use javascript on the client side to accomplish this?
Thanks,
Brian
...
What's the best way to determine the first key in a possibly associative array? My first thought it to just foreach the array and then immediately breaking it, like this:
foreach ($an_array as $key => $val) break;
Thus having $key contain the first key, but this seems inefficient. Does anyone have a better solution?
...
I'm trying to calculate the sum of an array of decimal values in PHP, but for some reason it keeps rounding to integers.
for example:
$oldArray = array(0.00,1000.11,988.92,978.22,964.01,953.07,948.82,917.26,902.56,913.21,904.08,898.86,892.79);
$myVar = 0.0;
for($k=1;$k<10;$k++)
{
$myVar += $oldArray[$k];
}
print_r($myVar);
$oldArray ...
Hi fellow programmers,
I'm wondering how to compress an PNG image correctly.
The situation is this :
I have a PNG image compressed and color-reduced with Irfanview on Windows. It's about 20KB.
When my portal software resizes (using magickwand 1.0.7) it with default values, it's about 63K (!).
Next try was to call MagickSetImageDepth...
I use Zend Framework to read an RSS feed is as simple as instantiating a Zend_Feed_Rss object with the URL of the feed :
$feed = new Zend_Feed_Rss('http://rss.exemple.com/feed');
echo $feed->title();
This method doesn't exists
echo $feed->version();
How I can get the version of Rss, like 2.0 or 0.92 ?
...