• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
update setting all fields to zero

Guess that could very well be likley as I'm currently developing this using EasyPHP5.3.9, not sure what database driver that uses?

Unless you have any other ideas I can try running this on a live server to find out.

If you're using a database in CodeIgniter, you have to configure the database settings in your application/config/database.php file. How can you configure that without knowing what driver you're using?

Sorry, Ok, sure, maybe I'm reading into this more then I need to - mysql?

$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'root';
$db['default']['password'] = '';
$db['default']['database'] = 'questionnaire';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;

Tried something in this link

Remove backticks

to remove the backticks from the mysql_driver.php but really strangly it don't cure the issue?

I'll keep at it and post any new findings.

If I recall some time ago, CI added ability to get past the back ticks. Take the following as an example:

$this->db->query('UPDATE QUERY GOES HERE', FALSE);

We send FALSE as the second parameter which escapes the ticks, does it not? Usually it's required when you do MySQL functions in the queries, for example, DATE_FORMAT().

EDIT: Sorry this was covered in the link above.

Managed to work out the problem, but its really strange and can't understand why!

In my view, under the header section I have the following html:

class="header"><a href="#"><img src="" alt="Insert Logo Here" name="Insert_logo" width="180" height="90" id="Insert_logo" /></a>
    &lt;!-- end .header --&gt;</div>

And its the the src="" bit thats causing the problem, as soon as I remove that I can updated to Database with no problem!

I have been able to do everything up to this point with that code intact, create records, display records, just an update resets all the records to 0.

Any ideas?

That can't possibly be causing errors in your PHP, unless it is corrupting the file when you save it or your code elsewhere is incorrect. HTML will not affect PHP in that way.

I know, strange right.

But its a fact, soon as I remove


or change it to something like:

src="&lt;?php echo base_url();?&gt;image/banner.jpg"

it works fine?


Did not work.

It's probably down to my coding somewhere as I'm still finding by feet with PHP and codeigniter - but happy to share my code or demonstrate it in someway.

Anyway, hopefully it may be of use to someone else so please post if it is.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.