how to create connection using class file in C# for windows application?... how to develop Data access layer... regarding 3-tire architecture using mysql databases
I am trying to learn how to create tags in PHP/MySQL. Does anyone know some good sites that help explain how to go about creating tags?
Tags as in the tags you see when you ask a question in stackoverflow.
I have a list containing a tuples and long integers the list looks like this:
table = [(1L,), (1L,), (1L,), (2L,), (2L,), (2L,), (3L,), (3L,)]
How do i convert the table to look like a formal list?
so the output would be:
table = ['1','1','1','2','2','2','3','3']
For information purposes the data was obtained from a mysql database.
I am pretty new to Linux. Got a VPS set up yesterday, installed Apache2, PHP5 and MySQL.
When I do apache2 -l I get this:
Compiled in modules:
core.c
mod_log_config.c
mod_logio.c
prefork.c
http_core.c
mod_so.c
When I do sudo a2enmod rewrite I get this:
Module rewrite already enabled
And rewrite.load is in /etc/apache2/mods-enabled.
Can anyone tell what's wrong?
Is there a good tutorial or sample project of how to upload data from iPhone to a self-owned web server? The project is like:
A survey application on iPhone which stores the user input data in a plist
When there is internet connection, the program will enable an "Upload" button
When the Upload button is clicked, the program will upload the data via HTTP form submit (POST)
The server is Linux + MySQL + Apache + PHP
The data should be sent via a https:// connection
I'm trying to disable logging of caching in production. Have succeeded in getting SQL to stop logging queries, but no luck with caching log entries. Example line in production log:
CACHE (0.0ms) SELECT merchants.* FROM merchants WHERE merchants.id = 1 LIMIT 1
I do not want to disable all logging, since I want logger.debug statements to show up in the production log.
Using rails 3.2.1 with Mysql and Apache.
Any suggestions?
im using doctrine and i have set up some test tables to be generated into models:
I want a many-to-many relationship models (3 tables converted into 3 models)
(things are simplified to make the point clear)
mysql tables:
user:
id INT // primary key
name VARCHAR
group:
id INT // primary key
name VARCHAR
user_group:
user_id INT // primary and foreign key to user.id
group_id INT // primary and foreign key to group.id
i thought that it would generate these models (from the documentation):
// User.php
class User extends Doctrine_Record
{
public function setTableDefinition()
{
$this->hasColumn('id');
$this->hasColumn('name);
}
public function setUp()
{
$this->hasMany('Group as Groups', array(
'refClass' => 'UserGroup',
'local' => 'user_id',
'foreign' => 'group_id'
)
);
}
}
// Group.php
class Group extends Doctrine_Record
{
public function setTableDefinition()
{
$this->hasColumn('id');
$this->hasColumn('name);
}
public function setUp()
{
$this->hasMany('User as Users', array(
'refClass' => 'UserGroup',
'local' => 'group_id',
'foreign' => 'user_id'
)
);
}
}
// UserGroup.php
class UserGroup extends Doctrine_Record
{
public function setTableDefinition()
{
$this->hasColumn('user_id')
);
$this->hasColumn('group_id')
);
}
}
but it generated this:
// User.php
abstract class BaseUser extends Doctrine_Record
{
public function setTableDefinition()
{
$this->hasColumn('id');
$this->hasColumn('name');
}
public function setUp()
{
$this->hasMany('UserGroup', array(
'local' => 'id',
'foreign' => 'user_id'));
}
}
// Group.php
abstract class BaseGroup extends Doctrine_Record
{
public function setTableDefinition()
{
$this->hasColumn('id');
$this->hasColumn('name');
}
public function setUp()
{
$this->hasMany('UserGroup', array(
'local' => 'id',
'foreign' => 'group_id'));
}
}
// UserGroup.php
abstract class BaseUserGroup extends Doctrine_Record
{
public function setTableDefinition()
{
$this->hasColumn('user_id');
$this->hasColumn('group_id');
}
public function setUp()
{
$this->hasOne('User', array(
'local' => 'user_id',
'foreign' => 'id'));
$this->hasOne('Group', array(
'local' => 'group_id',
'foreign' => 'id'));
}
}
as you can see, there is no 'refClass' in the 'User' and 'Group' models pointing to the 'UserGroup'. the 'UserGroup' table in this case is just another table from Doctrine's perspective not a reference table.
I've checked my table definitions in mysql. They are correct. user_group has 2 columns (primary keys and foreign keys), each one pointing to the primary key in either User or Group.
But i want the standard many-to-many relationship models in Doctrine models.
I'd appreciate some help. I have struggled to figure it out for a half day now.
What is wrong?
Thanks!
I have turkish character problem in mysql database when adding content with tinymce from admin panel.
Charset is:
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-9"" />
It accurs when add content in text area with tynymce. How can I solve this?
Thanks in advance
Hi:
I'd like to update values in one table based on corresponding values from other tables. Say you want to update prices of pieces provided by one specific manufacturer whose name is in the table Manufacturers with the Pieces table containing only the id of the manufacturer.
I've seen several solutions for MySQL here and for MS SQL Server here but none of them seems to work in SQLite.
Any suggestion?
I just want to know that if there is a simple way of judging what kind of apps can perform better on multi-core cpu? Such as Memcached, redis, MySQL, Cassandra and so on.
Hi there
If your planing to build an application but you don't have enough data to fill a database, how you will generate some ?
Do you know any application which can generate data based on some criterias and export it later in MySQL database?
Thanks :)
on my rails(2.3.5) app(currently 50-70rpm, maximum response time around 0.7s), uploading even 700k file(using paperclip plugin) locks up the server for web requests for everyone for 2 minutes! (other apps on same server work normally)
does anyone have a clue why that might be happening? i am using some mysql transactions which lock the database also if that might be an issue
i read http://www.therailsway.com/2009/4/23/uploading-files
but it couldn't be locking server for 2 minutes for a small file, could it?!
I'm joining a start up and there's a debate on which platform we should choose for our development; Mac, Linux or Windows?
We're gonna use mainly open source tools and languages like, ruby, rails, PHP and mysql and photoshop (or something equivalent on Linux) for design.
I suggested mac but they challenged me to be more persuasive. what's your idea?
Help me with your persuasive arguments please.
Is there any way to convert differential backup to SQL statements which will produce identical results when applied?
Or any other solution similar to binary log in MySQL?
Hi all, in Firebird the only way to have an auto increment coloumn is to setup a generator and use it with a trigger.
In H2 db there are auto_increment and identity keywords to do it.
What is the best way?
Mysql use auto_increment too, but there is some problems with cuncurrence read and table lock, isn't true?
Thank you.
I am reading the Head First PHP/Mysql book and they say to store both the user's username, email into cookies and sessions. Is it safe to assume that everyone nowadays accepts cookies? Or should I store both in sessions and cookies?
I am not storing any sensitive data in cookies such as password, etc.
Client Environment : Windows XP , Internet connection Available, PHP Not installed.
Server Environment : CentOS , Internet connection Available, PHP , MYsql installed.
Data are stored in files at client machine , suggest better ways to send data fetched from the file to the server. Normally i would be using HTTP request using Curl to send the data to the server but client machine doesnt have php installed.
What all are the ways to send data to the server and the comparisons?
how to create setup of database. I have windows application in c#.net i am able to create setup of my application in vs2008 but i want to create my MySql database server setup for multiple clients of my application. Please help me...
A colleague of mine sets reference to null in finally blocks. I think this is nonsense.
public Something getSomething() {
JDBCConnection jdbc=null;
try {
jdbc=JDBCManager.getConnection(JDBCTypes.MYSQL);
}
finally {
JDBCManager.free(jdbc);
jdbc=null; // <-- Useful or not?
}
}
What do you think of it?
I seem to keep running into little tidbits that help drastically in different areas of different languages.
For instance, a few days ago I learned about EXPLAIN SELECT... for any MySQL query that seems to be going slow. It took my 196 second query to 0.0084 seconds.
Could you please give me some suggestions on how to parse HTML in Perl? I plan to parse the keywords(including URL links) and save them to a MySQL database. I am using Windows XP.
Also, do I first need to download some website pages to the local hard drive with some offline Explorer tool? If I do, could you point me to a good download tool?
I'm creating an email generator system. I'm creating some clases and I'm trying to make things right.
By the time, I have created 5 classes. Look at the class diagram:
I'm going to explain you each one.
Person. It's not a big deal. Just have two constructors: Person(fname, lname1, lname2) and Person(token, fname, lname1, lname2). Note that email property stays without value.
StringGenerator. This is a static class and it has only a public function: Generate. The function receives a Person class and it will return a list of patterns for the email.
MySql. It contains all the necessary to connect to a database.
Database. This class inherits from MySql class. It has particular functions for the database.
This gets all the registries from a table (function GetPeople) and return a List. Each person from the list contains all data except Email.
Also it can add records (List but this must contains an available email). An available email is when an email doesn't have another person. For that reason, I have a method named ExistsEmail.
Container. This is the class which is causing me some problems. It's like a temporary container. It supposed to have a people list from GetPeople (in Database class) and for each person it adds, it must generate a list of possible names (StringGenerator.Generate), then it selects one of the list and it must check out if exists in the database or in the same container.
As I told above this is temporal, it may none of the possible emails is available. So the user can modify or enter a custom email available and update the list in this container. When all the email's people are available, it sends a list to add in the database,
It must have a Flush method, to insert all the people in the database.
I'm trying to design correct class. I need a little help to improve or edite the classes, because I want to separate the logic and visual, and learn of you.
I hope you've been able to understand me. Any question or doubt, please let me know.
Anyway, I attached the solution here to better understand it: http://www.megaupload.com/?d=D94FH8GZ
My script runs fine when I execute it from outside the application (terminal), but when its called from inside the C++ application it shuts down in the require("luasql.mysql") call.
Can anyone help?
I would need it to allow me to host subdomains and multiple domains is a huge plus.
Required:
ASP.NET 2.0, 3.0, 3.5
Subdomain Hosting
MS-SQL & MySQL Databases
Want
Multiple Domain Hosting
ASP.NET 4.0
Ability to directly connect to MS SQL using SQL SMS