php

sqlite ERROR no such column

Hi, Does anyone here have some experience with this error? Only If I use the WHERE clause, I get this error. I use php PDO to get the results. And this is my simple table $sql = "CREATE TABLE samenvatting ( stem_id INTEGER PRIMARY KEY AUTOINCREMENT, poll_id TEXT, stem_waarde_id TEXT, totaal INTEGER )"; $crud-...

How can I connect PHP 5.1 to Oracle 7?

I have been able to query newer Oracle databases using the PHP oci8 extension with the Oracle 10.2 Instant Client. Unfortunately, the Oracle Instant Client seems to be unable to connect to an Oracle 7 database (version 7.3.3 to be precise). Is there a way to query an older Oracle database from PHP? ...

Client-side or server-side processing?

So, I'm new to dynamic web design (my sites have been mostly static with some PHP), and I'm trying to learn the latest technologies in web development (which seems to be AJAX), and I was wondering, if you're transferring a lot of data, is it better to construct the page on the server and "push" it to the user, or is it better to "pull" t...

codeIgnitor helper file problem wont see anchor function

Hi everyone im new to a PHP framework codeIgniter, I am going over the user guide iv ran in to a problem, I am on the part where you load helper file but for some reason my code just isnt working I keep getting this error: Fatal error: Call to undefined function anchor() in /home/fresherd/public_html/CI/system/application/views/blogview...

preg match count matches

Hey guys quick question, I have a preg match statement, and it checks for matches, but I was wondering how you can count the matches. Any advice appreciated. $message='[tag] [tag]'; preg_match('/\[tag]\b/i',$message); for example a count of this message string should lead to 2 matches ...

What's the easiest and safest way to record data being inputted by a user on a web site

Apologies, this is a tragically simple question that will bore most of you. I need to implement the simplest "leave your email and we'll contact you" web page. The simplest thing I could think of is doing an HTML form which calls a PHP script which appends the data in some file on the server. Easy to implement, but now I'm wondering if ...

PHP Command Line running, zend framework set up problem

Hi, Im trying to learn how to set up a Zend framework web application from scratch. Ive been using Magento and I understand how powerful Zend is, but im over my head it seems like. So I bought a book, developing web applications with Zend 1.8 by Keith Pope, and I cant even follow past the first chapter. The thing that is confusing the ...

str_replace match only first instance

A followup question to http://stackoverflow.com/questions/3063704/ Given the following POST data: 2010-June-3 <remove>2010-June-3</remove> 2010-June-15 2010-June-16 2010-June-17 2010-June-3 2010-June-1 I'm wanting to remove ONLY the first instance of 2010-June-3, but the following code removes all the data. $i = 1; $pattern = "/<rem...

PHP Getting valuse of Arrays that are inside Objects

I'm running a query that looks like this: $results = $DB2->query("SELECT COUNT(*) FROM auth_user as count WHERE email='" . $DB2->escape_str($email) . "';"); It's returning an object that looks like this: DB_Cache Object ( [result] => Array ( [0] => Array ( [COUNT(*)] => 0 ) ) ...

php DOM, get values from xml document, php xml

I'm trying to get some information (itemID, title, price and mileage) for multiple listings from eBay website using their api. So far I got this up I've saved the document as .xml file using PHP cUrl and now I need to get/extract the values(itemID, title, price and mileage) into arrays and store them in database. Unfortunately I neve...

Help with regex - extracting text.

I have 3 separate strings: $d = 'Created on November 25, 2009'; $v = 'Viewed 17,603 times'; $h = '1,200 hits'; Which needs to be converted to: $d1 = {unix timestamp of November 25, 2009}; $v1 = "17603"; (commas stripped if it exists) $h1 = "1200"; (commas stripped if it exists) What is the most efficient way to do this (possibly w...

Copy and Paste Category in Magento

Dear all, I want to copy my first category to a second category in Magento. What should I do? Thanks, Wesley. ...

Help with an RSS Feed

Hi Everyone! I've spent ages on this, all I'm trying to do is extract the "title" contents from an rss feed, everything else can be ignored. I've looked into simplepie, magpie and all that stuff, but I feel its kind of overkill for what I need to do. I realise there are google gadgets that are made that can do this, but I didn't want al...

javascript error: variable is not defined

to is not defined [Break on this error] setTimeout('updateChat(from, to)', 1); I'm getting this error... I'm using Firebug to test and this comes up in the Console. The error corresponds to line 71 of chat.js and the whole function that wraps this line is: function updateChat(from, to) { $.ajax({ type: "POST", ur...

How To Correctly Specify A Default Value For A String Field In A PHP/MySQL Prepared Statement

I'm trying to debug some auto-generated code, but I am a mySQL noob. Everything goes fine ultil the "prepare" line below, and then for some reason $mysqli_stmt is false, yielding the stated error. Could it have something to do with the SQL_MODE = 'ANSI'? The failure seems to have something to do with the string 'xxx' below, but it sti...

/regexp?/ on HTML, but not in form

Possible Duplicate: RegEx match open tags except XHTML self-contained tags I need to do some regex replacement on HTML input, but I need to exclude some parts from filtering by other regexp. (e.g. remove all <a> tags with specific href="example.com…, except the ones that are inside the <form> tag) Is there any smart regex te...

MySQL SELECT Statement not working when executed from PHP

Hello all, I have the following piece of code, executing a pretty simple MySQL query: $netnestquery = 'SELECT (`nested`+1) AS `nest` FROM `ipspace6` WHERE `id`<='.$adaddr.' AND `subnet`<='.$postmask.' AND `type`="net" AND `addr` NOT IN(SELECT `id` FROM `ipspace6` WHERE `addr`<'.$adaddr.' AND `type`="broadcast") ORDER BY `id`,`subnet` D...

How to search for a specific word in a row in MYSQL?

I have a row that has keywords in this way (keyword1, keyword2, keyword3) separated by commas as shown. When a user signs in, you know that he wants information about (keyword1, keyword3). Now, I have another table that has bunch of information related to different keywords, this table has a row called (keywords) which indicates if this ...

FULLTEXT search(Mysql) is slow for the first time and then from second time onwards it gets much faster.

Hi, I have a table with 4000 records(Which is much easier to handle through full text search). when the search query is executed for the first time it is much slower. It takes about 5 to 10 seconds. Then it gets faster. If the site remains inactive for 10 or 15 minutes, and when I try to execute the query again it gets slower. I am usi...

codeigniter fatal error, trying to read database

Fatal error: Call to a member function result() on a non-object in C:\wamp\www\system\application\models\users_model.php on line 8 <?php class Users_model extends Model { function get_records() { $query = $this->db->get('users'); return $query->result(); } } ?> ...