Currently I'm using
<pre><code> code here </code><pre>
to display code. I'm pulling this information from a DB for a blog. The problem I'm having is that some of the code isn't showing. For example, in the source code I have this:
<pre><code><br />
echo '<ul class="mylist"><li><ul class="left">';
foreach($nameArray as $name) {
i...
I am running RoR, Ruby 1.8.6/Rails 2.3.2.
I am persisting a String within a model object to MySQL to a Blob field. For a number of reasons, I have to use MySQL Blob data type instead of a Text data type, yet I want Rails to treat the field as a regular String (instead of a binary String - which is what I think it is doing?).
How can I...
Hi all
I dont know if its a django bug or a feature but i have a strange ORM behaviour with MySQL.
class Status(models.Model):
name = models.CharField(max_length = 50)
class Article(models.Model)
status = models.ForeignKey(status, blank = True, null=True)
filters = Q(status__in =[0, 1,2] ) | Q(status=None)
items = Article.o...
Consider we have a field named (username) in our table named (tpl_users), now this table has lots of duplicated rows
I wrote this code to delete duplicated usernames:
Delete FROM tpl_users WHERE username = username;
How is it possible to delete duplicated usernames?
...
MySQL has something like this:
INSERT INTO visits (ip, hits)
VALUES ('127.0.0.1', 1)
ON DUPLICATE KEY UPDATE hits = hits + 1;
As far as I'm know this feature doesn't exist in SQLite, what I want to know is if there is any way to archive the same effect without having to execute two queries. Also, if this is not possible, what do you p...
I'm working with a content management system, and users are prompted with a confirmation screen before deleting records. Some records are foreign key referenced in other tables, and therefore they cannot be deleted.
I would like to display a message beside a given record if it has foreign key references. To know whether I should display...
Hi all,
I am trying to create a MySQL SELECT statement that will select a bunch of rows from a table and will group the results by the id of the row (multiple rows will have the same id).
Here's an example of what I'm trying to do. Let's say I have the following table:
id | name
1 | Art
1 | Arnold
1 | ...
i need to get started with accessing a database with c#
please give me the simplest example possible!!
perhaps a mysql database would be the simplest example?
please show me how to connect to a mysql database and get data
...
i am using wampserver
i opened the mysql prompt
i would like to know which databases i am able to connect to/view. how do i do this?
...
i am connect to a mysql database using this example:
http://bitdaddys.com/MySQL-ConnectorNet.html
at the top the instruction is to:
Next add reference to: MySql.Data
how do i do that?
...
Hi,
I am testing Paypal's masspay using their 'MassPay NVP example' and I having difficulty trying to amend the code so inputs data from my MySql database.
Basically I have user table in MySql which contains email address, status of payment (paid,unpaid) and balance.
CREATE TABLE `users` (
`user_id` int(10) unsigned NOT NULL auto_i...
i apologize in advance for the elementary questions
i am using:
command.CommandText = "select * from some_table;"
to retrieve data
can i do use the same thing to update data?
...
i have a mysql database:
/*
MySQL Data Transfer
Source Host: 10.0.0.5
Source Database: jnetdata
Target Host: 10.0.0.5
Target Database: jnetdata
Date: 5/26/2009 12:27:33 PM
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for chavrusas
-- ----------------------------
CREATE TABLE `chavrusas` (
`id` int(1...
select social_members.*
, social_mcouple.*
WHERE m_id = '".$_SESSION['userid'] . "'
AND c_id = '".$_SESSION['userid'] . "'
Select all fields from social_members.* and if social_mcouple.c_id = $_SESSION['userid'] then Select all fields from social_mcouple.* as well. Can this be done with IF EXIST and if so how. Thanks
...
Hi,
How do I check the number of records returned from a search of my MySQL database
with a statement like this:
$searchKey = 'Something to search for';
$searchResults = Doctrine::getTable('TableName')->createQuery('t')-
>where('columnName LIKE ?','%'.$searchKey.'%')->execute();
...
How would I list a page of the top commented pages on the site with PHP and mysql?
The database is set up sort of like this:
page_id | username | comment | date_submitted
--------+----------+---------+---------------
1 | bob | hello | current date
1 | joe | byebye | current date
4 | joe | stuff | d...
I have 2 database fields
`decval` decimal(5,2)
`intval` int(3)
I have 2 pdo queries that update them. The one that updates the int works ok
$update_intval->bindParam(':intval', $intval, PDO::PARAM_INT);
but I can't update the decimal field. I've tried the 3 ways below, but nothing works
$update_decval->bindParam(':decval', $decval...
I am using Tomcat 6. I am running a php script using the JavaBridge. I get the following error when I run my code.
Fatal error: Call to undefined function mysqli_connect() in C:\Program Files\apache-tomcat-6.0.26\webapps\JavaBridge\xxxx\xxxxx.php on line 534
Please help.
...
I have a large mysql table that I think might be using the wrong character set. If so I'll need to change it using
ALTER TABLE mytable CONVERT TO CHARACTER SET utf8
But since this is a very large table, I'd rather not run this command unless I have to. So my question is, how can I ask mysql what the character set is on a particular t...
I'm getting ready to deploy a CakePHP site for the first time. I'm using the site with a MySQL database, and I'm still a little unclear about the proper use of users & permissions for MySQL -- I'm talking about the "login" and "password" fields that appear in app/config/database.php. During development, I've been using 'root' and 'root' ...