w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Connecting form to database errors
The error indicates the index Name is not found in the $_POST[] array. It is a PHP notice, and not a show-stopping error, but rather is intended to communicate that you are referencing a value which does not exist. If it is normal/expected that this value might be empty/null then the notice can be safely ignored. Beyond this problem, you should be sanitizing public values prior to referencing within the SQL statement, ie: $name = mysql_real_escape_string($_POST['Name']); $email = mysql_real_escape_string($_POST['Email']); A few other notes: In the call to mysql_connect() it is not necessary to wrap variables $host, $username or $password in quotes. The same is true with $db_name in call to mysql_select_db(). They are already strings as defined in the lines above and so this is excess

Categories : PHP

Data-centric application: separate database tables for separate organizations a good idea?
I was wondering whether rather than have a single set of tables, it would be much safer to have a separate set of tables for each client, all running within the same database. If you want to do this, you have a separate set of tables for each client, running in different logical databases. It's easier for the DBAs to manage. You're basically admitting that you can't depend on your application code to keep the firms separate when sharing the same database tables. Since each firm will have around 20-40 tables, will the number of tables tend to explode in magnitude with number of users, thus slowing down the database altogether? You're either going to have 20 - 40 tables for each firm, or 20 - 40 large tables for all the firms. The amount of storage will be about the same either

Categories : Database

Symfony 2 - separate form logic, show form errors after redirect
If you check out how the code generated by the CRUD generator handles this you will see that a failed form validation does not return a redirect but instead uses the same view as the GET method. So in your example you would just: return $this->render("YourBundle:Contact:contact.html.twig", array('form' => $form->createView())) rather than return the redirect. This means you do not lose the form errors as you do in a redirect. Something else the CRUD generator adds is the Method requirement which means you could specify that the ContactSendAction requires the POST method and thus not need the extra if($request->isMethod('POST')){ statement. You can also just return an array if you specify the template elsewhere, for example you could use the @Template annotation and then

Categories : Symfony2

Magento: How to separate mobile phone numbers saved in database as telephone attribute and put it into database under new name?
just go throw this step I found the following tutorial which was incredibly helpful: http://www.magentocommerce.com/wiki/5_-_modules_and_development/customers_and_accounts/registration_fields Unfortunately my theme did not have the register.phtml file located in: app/design/frontend/default/yourtheme/template/customer/form/ After reading a few other Stack Exchange and forum posts I found that in this case Magneto default's to the base located in: app/design/frontend/base with the register.phtml file located at /app/design/frontend/base/default/template/customer/form/register.phtml Here's the catch that some of you also might be running into. After thinking I had figured it out, I made changes to this file and...nothing, no update on the frontend. I tried flushing the caches but it didn't

Categories : Database

How to save the information from additionally added fields in CreateUserWizard in separate database, which is different from the Membership database?
Inorde to store your custom data, you need to make use of, Membership profiles. You find more info over here http://msdn.microsoft.com/en-us/library/taab950e%28en-US,VS.80%29.aspx http://weblogs.asp.net/scottgu/archive/2005/10/18/427754.aspx http://odetocode.com/Articles/440.aspx

Categories : C#

what does "Connecting to database specified by database.yml" in the log file mean?
Check this answer. This may help you. Rails Connecting to database specified by database.yml

Categories : Database

Error in connecting aspx.cs to database situated in app_data folder [database connection error]
Have you tried localhost as opposed to (LocalDBv11.0), like this? objconn.ConnectionString = "Data Source=localhost;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|test.mdf;User Instance=true;user id=xyz; password=xyz123; Initial Catalog=TEST"; localhost will use TCP, while (LocalDBv11.0) will use Named Pipes

Categories : C#

PHP: Not connecting to database
You need to add "" around the fields you are about to insert. You presently have: $query="INSERT INTO user (fname, lname, username, password)"."VALUES('$fname', '$lname', '$username', '$password_hash')"; Do this instead: $query='INSERT INTO user (fname, lname, username, password) '. 'VALUES("'.$fname.'", "'.$lname.'", "'.$username.'", "'.$password_hash.'")';

Categories : PHP

Connecting to a database in C#
You have an SDF file, meaning that you connect to a Sql Compact not to Sql Server. You need to use the classes in the namespace System.Data.SqlServerCe SqlCeConnection conn = new SqlCeConnection(source); Also, I am not sure of this, but I think you don't need to have single quotes around values in the connection string string source = "Data Source=E:\Documents\Database\MyDatabase.sdf;" + "Password=password;" + "Persist Security Info=False;";

Categories : C#

JSP - connecting to a database
Your intuition is right. You should not connect from the JSP directly to the database, if that is even possible. Most programs consist of several layers. For example: You have the DAO (Data Access Object) which has one responsibility: getting data from the database. It does not care what happens with that data, but it retrieves it. Then you have the service layer which does business logic, calculations, etc. It does not care where the data comes from, it just assumes the data is there (but it is from the dao) Then you have the user interface layer which prepares the information to be used in JSP's, does transformations that the JSP cannot do, filter out information that is not required, etc. And once again, it does not know anything about where the data comes from, it just gets it from

Categories : Java

Connecting to database server using php
This should be basically the mysqli version of what you wrote. <?php $username = "user"; $password = "pass"; $hostname = "creative.coventry.ac.uk"; $mysqli = new mysqli($hostname, $username, $password, "asantec"); $stmt = $mysqli->prepare("SELECT * FROM books;"); $stmt->execute(); $stmt->bind_result($id, $title, $author, $price); //Put all your expected variables here while ($stmt->fetch()) { echo $id.'<br />'; echo $title.'<br />'; echo $author.'<br />'; echo $price.'<br /><br />'; } $mysqli->close(); ?> Also, if you have any issues in the code you've posted, this will work. Check your DB credentials and the data you're querying.

Categories : PHP

Connecting to a MySQL database with PDO
First the reason you define config in different file is so that you can just include that file instead of writing the database configuration anytime you want database access. It is preferred best practice. you can do: try { $PDOConnection = new PDO('mysql:host='.DB_HOST.';dbname='.DB_NAME.'', DB_USER, DB_PASS); $PDOConnection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); //Do you stuffs $PDOConnection = null; } catch(PDOException $e) { //Do something with error }

Categories : PHP

Connecting Oracle database with C#
Change your version to the higher framework, rigth click on your project, change the framework, fix the references and recompile. If you have dependencies, first do the dependencies. See this: http://msdn.microsoft.com/en-us/library/bb772098%28v=vs.90%29.aspx

Categories : C#

connecting to a database in mysql using php
You're using the old mysql library which is a no no Get comfy with the Mysqli Extension for all your database access needs. I'll even refactor this a bit for you. $conn = new Mysqli('localhost', 'demo', 'abc', 'practice'); $sql = "SELECT*FROM contact"; $results = $conn->query($sql); while($row = $results->fetch_assoc()) { var_dump($row); } edit: JimiDini posted a link that you should definitely read. http://phptherightway.com/

Categories : PHP

Connecting to database in Express
You're missing the mysql module. var express = require('express') , http = require('http') , mysql = require('mysql'); But also you need to connect(): connection.connect(); Before you start querying the database. All-together now for laziness: var express = require('express') , http = require('http') , mysql = require('mysql'); // <---- HERE var app = express(); var connection = mysql.createConnection({ host: 'localhost', user: 'root', password: "root", database: 'restaurant' }); connection.connect(); // <---- AND HERE // all environments app.set('port', process.env.PORT || 7002); app.get('/',function(request,response){ connection.query('SELECT * FROM restaurants', function(err, rows, fields) { console.log('Connection result erro

Categories : Node Js

Connecting to mysql database with go
connection refused generally means the port isn't open or is being blocked by a firewall. A couple things to check: Is MySQL (on localhost) running? Is it on port 3306? If you're on Windows, Mac or Linux, is there a firewall that might be blocking port 3306? If you're on Linux, is SELinux enabled that might be blocking port 3306?

Categories : Mysql

c#: Connecting to php Mysql database
Try this //create a MySQL connection with a query string MySqlConnection connection = new MySqlConnection("server=localhost;database=cs;uid=root;password=abcdaaa"); //open the connection connection.Open(); //close the connection connection.Close();

Categories : C#

connecting to an SQL Server database
The problem your having with regards to connecting to the database on a server is because of SqlConnection dbConnection = new SqlConnection("Data Source=.\SQLEXPRESS;Integrated Security=true"); The best way to do this is to go to your Web.config file and find the block and add a connection to your database in there. eg <add name="ConnectionString" connectionString="Data Source=YOUR SERVER;Initial Catalog=YOUR DATABASE;User ID=YOUR USER ID;Password=YOUR PASSWORD" /> then you can just call the connection string accross your whole project whenever you need to use it. Also with regards to VS2012. There are very few companies using that IDE at the moment so your probably better off learning VS 2010 in the most part but i would agree that VS2008 is fairly out of date now

Categories : C#

Connecting to a MS Access database
Try this, assuming you have the PDO odbc driver installed and enabled on the web server. $user='Admin'; $password=''; $mdbFilename="Custos_TAB.accdb"; $connection = odbc_connect("Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=$mdbFilename", $user, $password); $sql="SELECT * FROM [tblHere]"; $rs=odbc_exec($connection,$sql); //do stuff here odbc_close($connection); or $user='Admin'; $password=''; /*if you have a path here such as c:dbCustos_TAB.accdb, make sure to use double backslashes, (i.e "c:\db\Custos_TAB.accdb")*/ $mdbFilename="Custos_TAB.accdb"; $conn = new PDO("odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=$mdbFilename;Uid=$user='Admin';Pwd=$password;"); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTI

Categories : PHP

Effects of connecting to the database manually in vb.net
i come from both backgrounds. yes you can manually open database BUT you should specify the database you are using to make the best performance in your desktop application, for example: in access database (mdb files), you should open the database once in form_load, and use it all the time, then close it before exitting the application in form_closing (this is for better performance) while in SQL Server, you should open the database for each function then do your queries then close it after you finish.

Categories : Vb.Net

Error connecting to SQL Azure Database
Step 1: Simplify your connection string. Ours looks like this: <add name="[CONTEXTNAME]" providerName="System.Data.SqlClient" connectionString=" Server=tcp:[SERVER].database.windows.net,1433; Database=[DATABASE]; User ID=[USER]@[SERVER]; Password=[PASSWORD]; Trusted_Connection=False; Encrypt=True; Connection Timeout=30;"/> So looking at your connection string, I would try something like: <add name="MyEntities" providerName="System.Data.SqlClient" connectionString=" metadata=res://*/Model.ModelMy.csdl|res://*/Model.ModelMy.ssdl|res://*/Model.ModelMy.msl; Server=myserver.database.windows.net; Database=MyDatabase; User id=myUser@myserver; Pa

Categories : SQL

ODBC Connecting to SQL Database in PHP Error
My thought would be that the ODBC DSN "Vertices" is setup incorrectly on the machine itself. My suggestion would be to try a code similar to: $conn = odbc_connect("Driver={SQL Server Native Client 10.0};Server=YOURSERVERDatabase=DATABASE", 'correctusername','correctpassword'); $query = odbc_exec($conn,"SELECT * FROM tblOrder ...") or die (odbc_errormsg()); Other connection strings, if the above fails, can be found at http://www.connectionstrings.com/sql-server/ My other thought that the user permissions inside the database are not correctly setup to allow correctusername to access the database

Categories : PHP

Connecting a MySql database to AngularJS via PHP
Hmm. When I add in some fake data in your getSamples() callback things generally seem to work, including your filter. See my forked plunker for reference: http://plnkr.co/edit/9fCkQfOsj6kJDILhMebY?p=preview

Categories : PHP

Visual Basic Connecting to Database
performQuery function is faulty. It never closes the connection (Return dbDataReader happens before connection is being closed). On one hand - it's a good thing, because DataReader is useless without open connection. On the other - connection is opened as a private variable inside of a function so it goes out of scope when the function is returning and you never know when Garbage Collector will decide to collect it. It's always fun when this happens in the middle of Reader.Read.

Categories : Database

connecting android to .net web service database
You have to implement KvmSerializable.You can see ksoap2-android,CodingTipsAndTricks for more details. that is a very good tutorial.

Categories : Android

Connecting to Oracle database(Not XE) without being on network
Your listener has to be configured to listen to your localhost internal interface, 127.0.0.1, for you to be able to connect when not on a network. If it's only configured with your network adapter's IP address you will only be able to connect while on the network. When you unplug your LAN cable the interface associated with that IP is disabled and no longer reachable, even from within your PC. You will also have problems if your IP is allocated by DHCP, and would need to use a DNS name that follows reallocation; that's why servers usually have fixed IPs. You can configure the listener to use both addresses if you need to be able to connect locally when off the network, but have other clients connect to your database when you are on the network. Having a DB that others need to access on a

Categories : Database

iOS & bootstrap connecting to external database
You are correct. To get data from an external database you will need to make a webservice call To a script that returns the data you wish to use. You can get the data back in JSON or XML format. I prefer JSON as I think it is easier and simpler. AJAX would be a good way to make calls for your data. Its a good idea to make a mix of both. You can use and webserver to store all your data but if the user is in an area that they can't use data then it would render your app useless. Normally I keep all the data I need on a server then download and store it in the apps DB for that user. You can then make a request to the server at intervals to see if there is any new data to be downloaded. I would suggest doing a similar thing for the bootstrap site.

Categories : Android

Connecting to sql server 2008 database using C#
You connection string is wrong. It should be of this form if you use SQL Server Authentication: Server=myServerAddress;Database=myDataBase;User Id=myUsername; Password=myPassword; Where myServerAddress is the IP or host name of the computer running SQL Server. If it's your PC, localhost will probably work. myUsername and myPassword are the credentials of the user connecting to the server. If you use Trusted Connection,you connection string should be of this form: Server=myServerAddress;Database=myDataBase;Trusted_Connection=True; You can check more examples here: http://www.connectionstrings.com/sql-server/

Categories : C#

Not seeing database from localhost but seeing it when connecting to server
GRANT USAGE is not what you want. According to the mysql documentation: USAGE Synonym for “no privileges” It is used at the global level with GRANT to modify account attributes such as resource limits or SSL characteristics without affecting existing account privileges. http://dev.mysql.com/doc/refman/5.1/en/grant.html You need to grant actual privileges to your "someuser" user for the database the user needs to see. For example, if you grant select privileges on the mysql.*: GRANT SELECT ON mysql.* TO someuser@localhost IDENTIFIED BY "somepassword"; FLUSH PRIVILEGES; Now, someuser connected from localhost will be able to see the mysql database when executing SHOW DATABASES; However, you might want to reserve the access to the mysql database for root only.

Categories : Mysql

Connecting to SQL Local Database using ConfigurationManager ASP.NET/C#
You don't have a connection string named Database1, it's named ConnectionString. Change your code to ConnectionStrings["ConnectionString"]. UPDATE: looks like the OP already fixed that. That error tends to indicate that your SQLEXPRESS instance isn't up and running. Make sure the services are started and the server is running.

Categories : Asp Net

Connecting to MySQL(WAMP) database with PHP
I'm going to say that you have a quotes error in your insert code. Use escapes, double quotes, or some other mechanism to separate the quoted variables from the quoted string, like so: $insertRow = "INSERT INTO people(fname, lname, age, city) VALUES('$fname', '$lname', '$age', '$city')";

Categories : PHP

Connecting to a MySQL embedded database from PHP
As I am aware, the only embedded database which PHP supports is SQLite. In any other ways of trying to connect to MySQL database (with MyISAM engine) you would need either to expect resource from queries, PHP compatible objects, which non of them is the binary format of MyISAM files. At least, Embedded databases are widespread in application programming, not so much in web programming. However, I found something, that converts MyISAM to SQLite http://www.fullconvert.com/MyISAM-to-SQLite/ Managing SQLite with php is simply done by sqlite_ functions which creates files for db's and tables, execute queries, etc. Small tutorial: http://www.techotopia.com/index.php/PHP_and_SQLite PHP SQLite official documentation: http://php.net/manual/en/book.sqlite.php

Categories : PHP

Issue connecting second database in Codeigniter
//this will work sure or check your errors //If you use group //group name $preview_DB = $this->load->database('preview',TRUE); //another DB $another_DB = $this->load->database('another',TRUE); //if You use array //create connection string $db = array(); $db['hostname'] = "database_hostname"; $db['username'] = "database_username"; $db['password'] = "database_password"; $db['database'] = "database_name"; $db['dbdriver'] = 'mysql'; $db['pconnect'] = FALSE; $DB = $this->load->database($db,TRUE);

Categories : PHP

Connecting to a database in Visual Studio
Yes, the database can be remotely hosted, I'have this working on my local machine with a remote MsSql database. Make sure the remote database server accepts connections from your IP. I'm pretty sure the MsSql Server Management Studio is only for MsSql, not MySql. The server name in my case is the IP for the remote MsSql database server, further you need the login and password for your database. But if you use your remote MySql, you don't need this tool. I have no experience with MySql, but it must be possible to use the database in your Visual Studio project with the correct "connectionstring". The connectionstring contains the type of the database, where it is located, login and pasword, etc. You can find the syntax of you connectionstring here: www.connectionstrings.com/mysql/

Categories : Mysql

Not connecting to database from local website
First, ensure that the connection information is correct (server and database name). Then make sure that 'Remote Connections' are enabled in SQL. Also, since it is .Net, you could grab a .Net decompiler (perform a Google search) that will allow you to decompile the DLLs and view the most of the source code. This is probably your last option, but would allow you to at least view what the page is doing and gives you a starting point if you had to redevelop the site.

Categories : C#

connecting to an oracle database from PHP oci8
I had to remove the ";" semicolon from the php.ini file at the oci8 line it was like this: ;extension=php_oci8.dll i changed it to: extension=php_oci8.dll

Categories : PHP

working of where condition in sas proc sql, while connecting to some other database
If you're getting the same number of records back, it'll take the same amount of time to process the query. This is because the I/O (transferring data back to SAS and storing it) is the most time-consuming part of the operation. This is why the lack of index doesn't make a big impact on the total time. If you adjust your query so that it returns fewer rows, you will get faster processing. You can tell whenever this is the case by looking at the SAS log, which will show you how much time was used by the CPU (the rest is IO): NOTE: PROCEDURE SQL used (Total process time): real time 11.07 seconds cpu time 1.67 seconds

Categories : SQL

Vb Connecting to an online mysql server database
"I have turned my firewall off but I'm still getting the same error." There is far more filtering going on between you and the destination than your personal firewall, none of which you'll be able to directly disable/change. If the server IP in your example is what you're trying to connect to, then it is very likely a filtering/firewall issue, as cHao mentions. SQL Server's default connection port is tcp/1433, and based on a quick portscan of 188.121.42.33, that host is not accepting connections on tcp/1433: > nc -vv 188.121.42.33 1433 nc: connect to 188.121.42.33 port 1433 (tcp) failed: Connection timed out ...and... > nmap -O 188.121.42.33 Starting Nmap 6.25 ( http://nmap.org ) at 2013-09-05 22:01 ric Nmap scan report for n1nlsmysqladm01.shr.prod.ams1.secureserver.net (188.121

Categories : Mysql

Connecting a Java application to an SQL database with Eclipse
You have to add the SQL JDBC Driver in your project libraries. download jtds.jar and add to your libraries. And follow the code below. public static void mian (String[] args) throws Exception{ Connection conn=null; String url="jdbc:jtds:sqlserver://YourServerIp:1433/dbName"; String username="sa"; String password="****"; String driver="net.sourceforge.jtds.jdbc.Driver"; // Step 1: Load the JDBC driver. Class.forName(driver); // Step 2: Establish the connection to the database. conn= DriverManager.getConnection(url, username, password); } Here you have to follow two steps

Categories : Java

Connecting to a Cache (InterSystems) Database using Java
For Android development, I would highly recommend to use web services or Rest instead of ODBC. But there is a standard JDBC Java documentation (not sure if it will work in Android at all though): http://docs.intersystems.com/cache20131/csp/docbook/DocBook.UI.Page.cls?KEY=ITECHREF_jdbc You can also have a look at newer Zen Mobile framework designed specially for iOS/Android Cache development, ask for a copy in WRC

Categories : Java



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.