I have two fields... one is category name and other is document title... When i click on submit... the document title should be saved in document table linking to the category name selected... which is in other table.
A category can have n number of document titles...
$result = mysql_query("UPDATE stinky_menu SET description = '$doc...
I'm working on a storefront application in PHP with MySQL. I'm currently storing my data in 4 tables: one for product lines, one for specific products within those product lines, one for product images, and one which specifies which images are linked to which specific products. Each specific product belongs to one product line, each prod...
Hi, was wondering how to do a search result using PHP + MySQL but not show all the data in the result but only a SUMMARY (lets say limited to 200 characters). And the summary would exactly contain the keyword portion. So -100 characters+keyword+100 characters might be how it would be shown.
Thanks!
...
How do I obtain the HTTP headers in response to a POST request I made with PHP?
...
My app is working from the web side of things.
I'd like to get the CLI working so that I can run unit tests and the such
Here's what I have for a test script:
$pthRoot = dirname(__FILE__);
define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/..'));
define('APPLICATION_ENV', 'development');
define('SERVER_ROLE', 'development');
s...
I am using the PDO Database Abstraction library to make sure my code is portable. However, I now find that I need column information so I turned to the PDOStatement->getColumnMeta() method hoping it would be somewhat standardized - but from what I have found it actually seems open-ended.
For example, when calling that method from SQLite...
I need to parse some HTML files, however, they are not well-formed and PHP prints out warnings to. I want to avoid such debugging/warning behavior programatically. Please advise. Thank you!
Code:
// create a DOM document and load the HTML data
$xmlDoc = new DomDocument;
// this dumps out the warnings
$xmlDoc->loadHTML($fetchResult);
...
I have a command line process that needs to use code in one of my controllers. When I try to construct the controller, I get an error:
Catchable fatal error: Argument 1 passed to Zend_Controller_Action::__construct() must be an instance of Zend_Controller_Request_Abstract, none given,
I assume the controller wants the request so it ca...
I am using the following code to initialize a model from within my controller:
$this->load->model('model_name');
Is it possible to modify the above line somehow so that the model constructor recieves a parameter? I want to use the following code in the model constructor:
function __construct($param_var) {
parent::Model();
$th...
My henchman is learning PHP currently,
and he sent me his PHP code,
and I found that he uses $_REQUEST in his code.
The textbook I read says that
$_REQUEST has security problem so
we better use $_POST.
so I replied to the henchman that
we better to use $_POST.
Is this OK?
...
I'm working on a google maps project, where you add addresses to a database, and then click a "geocode these addresses" type of button. It will then take you to a page telling you how successful it was.
However, if google doesn't recognize an address, I want there to be a list of those addresses at the top, with textboxes to either spe...
Hi, I have a class to connect to my database, strip stuff and return things from a db query. Anyhow, the problem I am having is that I am tryinmg to call runQuery() method but every time I try, I get this error:
Fatal error: Call to undefined function runMyQuery() in DatabaseConnector.php line 22
Any ideas perhaps? I know runQuery ...
hey all,
firstly, i have no php experience whatsoever, and that's the main reason i need help in the first place...
you may have heard of this before, but there's an awesome server transfer script called RapidLeech (rapidleech.com)
basically, it downloads files from many popular file sharing sites to your server, and allows you to upl...
When declaring an associative array, how do you handle the indentation of the elements of the array? I've seen a number of different styles (PHP syntax, since that's what I've been in lately). This is a pretty picky and trivial thing, so move along if you're interested in more serious pursuits.
1) Indent elements one more level:
$arr...
In the past, I've handled user image uploads in two different ways:
Save the image data in a database table, and load it via a PHP script
Upload the image, convert it to jpeg, put it in a directory and load it via HTML tags
The first option worked fairly well, but I had to keep fairly constraining size restrictions on uploaded images...
I'm wanting to assign a variable only it hasn't already been assigned. What's the PHP way of doing the following?
$result = null;
$result ||= check1();
$result ||= check2();
$result ||= "default";
I checked the standard operators and the is_null function, but there doesn't seem to be an easy way of doing the above operation.
...
Hi I'm trying to make some form send back to the person who fill up these forms as a references. However I keep getting error in line 5. Which i don't see any problem. Can anyone guide me? Thanks!
<?php session_start();
require_once 'opendb.php'
$subject = "Refrence";
$refemail = "Here is the list for your refrence";
$class_name = $_P...
Hi,
In general, I have the following scenario:
- Fetch product and its related data from database
- Convert fetched data to php 'product' object
- cache product object in session
The cache is readonly, i.e customers viewing products on the site.
But there are calls like getProductIdsByCategory($categoryId) and the productIds from thes...
Lately I've been thinking a lot about building a website/blog/community oriented site. However I can't decide if it's a good idea to build it using Wordpress as a base.
I've been reading around the Internet, and I've seen that many users have trouble with Wordpress using lot of CPU and other resource related problems.
So, what do you t...
I'm designing a site. It is in a very early stage, and I have to make a decision whether or not to use a SingleSignOn service provided by the server. (it's a campus site, and more and more sites are using SSO here, so generally it's a good idea).
The target platform is most probably going to be django via mod_wsgi. However, any documenta...