MySQL database accessor
The database accessor wizard connects successfully to the
MySQL database and shows the table I created.
However, in the "Generate server-side code" step of the
wizard, I receive "The selected Project doesn't contain a valid
server nature!". My Flex project uses Live Cycle Data Services as
the server type. I have tested that Live Cycle DS is installed
correctly and functioning.
Is there any documentation on resolving the "The selected
Project doesn't contain a valid server nature!" error?
Thank you
Try installing WTP onto your Eclipse implementation then
install something like JBoss. Also, install LiveCycle again but
choose the J2EE install.
Now run the Data Accessor again for a new project. This time,
you'll be able to select J2EE instead of LiveCycle... select JBOSS
as your app server and then you can choose LiveCycle as your data
communication method. You'll need to select 'flex.war' from your
LCDS J2EE directory along the way.
This should work.
And then you'll most likely find yourself in this situation:
http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=72&catid=651&threadid =1295102&enterthread=y
I posted that under an old ID by mistake but it's me - and
it's where I'm at right now... a little further along from you but
still hitting brick walls nonetheless! Really hoping there's going
to be a new beta out soon because this one is so broken in this
area - particularly with accessing Oracle - the wizard won't even
work on that at all which is why I'm messing with mySQL right now
instead.
Anyway, hope this helps.
Jamie.
Similar Messages
-
Pardon my ignorance. I've been playing w/the new Flex 3
Beta.... I'm very happy w/the most recent improvements
One thing that I really think adobe underestimated was the
Database Accessor wizard..... I can't find any docs, tutorials, or
napkin drawings to tell me in more details how cool and great it
is......... perhaps is my lack of flex hardcore experience.... but
how do other people connect to MySQL from a Tomcat server without
using Remoting, or the LiveCycle thing? I mean, can Flex output JSP
code as well as wut the wizard outputs PHP? or is there any other
magical way of doing this {The "on-a-budget(free)"} way without
buying the liveCycle thing, or going Remoting?
I'm trying to migrate an old Flash mx 2004 app that uses
OPENAMF onto Flex, unfortunately buying the livecycle thing is out
of the question, and as a bonus......OPENAMF doesn't support AMF3,
and apparently no one has updated their site since Colombus
discovery.... Sooo, my only choices are some sort of open source
solution......it needs to be simple and fast.
I know about webservices, and xml, etc. ......but I was just
trying to minimize the transitions by not having to re-write all of
our Java classes.Hi, have you seen our beta tutorial for the Data Wizard?
http://labs.adobe.com/wiki/index.php/Flex_3:Feature_Introductions#Introductory_Data_Wizard s
You absolutely can use the wizard to connect to MySQL on a
Tomcat server without LCDS. Just select the "XML over HTTP" option
in the wizard. (The "LCDS" tutorial shows this -- it picks the LCDS
option but it also shows the place where you can select XML over
HTTP instead.) The wizard will generate a Java servlet. It doesn't
generate JSP code, but that's not really applicable here since it
can generate the underlying servlet directly.
So, this means you'll be using a different way of encoding
the data over the wire (XML instead of AMF/remoting as your old app
did), but the wizard generates code for handling the
encoding/decoding of your application and server data into XML, so
it shouldn't make much difference to your app.
Hope that helps,.
Tom -
I successfully connected to a local mysql database using the
Database Accessor. How do I access the data now? Where would be the
dataProvider info to use once the connection is setup?Hi,
Please give me more information about what you did? have you
managed to press finish on the Database Accessor wizard? If yes,
have you managed to run the resulted code? It is working for you?
This wizard was created to show a quick sample on how to
access data from Flex using a server technology.
Regards,
Miti -
Connecting to a Mysql database using CF Administrator and DW
I can't create a mysql datasource in CF Administrator.
If I use the following datasource settings in CF
Administrator:
JDBC URL: jdbc:mysql://localhost:3306/test
Drive Class: MySQL Connector J
AND (note the emphasis) I set my local and remote folders in
my DW site local folder, remote folder and testing server folders
all to C:\CFusionMX\db\, I can connect to my mysql database in CF
Administrator.
However, with these DW site folder settings, DW doesn't
recognize any databases (Access or Mysql) at all.
When I change my DW site folder settings to 'wwwroot'
(e.g.local folder C:\CFusionMX\db\' is changed to
'C:\CFusionMX\wwwroot') DW now lists all my CF Administrator
databases.
The problem is CF Administrator can't connect to my Mysql
data sources. It gives me the error:
"Connection verification failed for data source: javaserver
[]java.sql.SQLException: SQLException occurred in JDBCPool
while attempting to connect, please check your username, password,
URL, and other connectivity info.
The root cause was that: java.sql.SQLException: SQLException
occurred in JDBCPool while attempting to connect, please check your
username, password, URL, and other connectivity info"
I've tried changing the 3306 port to 8500, but this doesn't
help.
My java path and connector file is:
C:\CFusionMX\wwwroot\WEB-INF\lib\mysql-connector-java-3.0.17-ga-bin.jar,
Is this a ID/password problem? I've tried both 'root' and
leaving the ID field in the CF Administrator add data source block,
both to no avail. I don't have a password set in Mysql for 'root'
either.
Any help would be gratefully appreciated. I've been working
on this for weeks and keep running into one problem after another.
Thanks a million in advance.
Sincerely,
Graham A. Kerby1) ensure mysql server is running
2) there are numerous tutorials for mysql installation out
there
3) there are good free mysql admin tools out there
4) use both the above to verify your mysql installation is
correct
5) please tell me you do have your zonealarm DISABLED
hth
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com -
Connecting to a Mysql database using a ColdFusion server
can't create a mysql datasource in CF Administrator.
If I use the following datasource settings in CF
Administrator:
JDBC URL: jdbc:mysql://localhost:3306/test
Drive Class: MySQL Connector J
AND (note the emphasis) I set my local and remote folders in
my DW site local folder, remote folder and testing server folders
all to C:\CFusionMX\db\, I can connect to my mysql database in CF
Administrator.
However, with these DW site folder settings, DW doesn't
recognize any databases (Access or Mysql) at all.
When I change my DW site folder settings to 'wwwroot'
(e.g.local folder C:\CFusionMX\db\' is changed to
'C:\CFusionMX\wwwroot') DW now lists all my CF Administrator
databases.
The problem is CF Administrator can't connect to my Mysql
data sources. It gives me the error:
"Connection verification failed for data source: javaserver
[]java.sql.SQLException: SQLException occurred in JDBCPool
while attempting to connect, please check your username, password,
URL, and other connectivity info.
The root cause was that: java.sql.SQLException: SQLException
occurred in JDBCPool while attempting to connect, please check your
username, password, URL, and other connectivity info"
I've tried changing the 3306 port to 8500, but this doesn't
help.
My java path and connector file is:
C:\CFusionMX\wwwroot\WEB-INF\lib\mysql-connector-java-3.0.17-ga-bin.jar,
Is this a ID/password problem? I've tried both 'root' and
leaving the ID field in the CF Administrator add data source block,
both to no avail. I don't have a password set in Mysql for 'root'
either.
Any help would be gratefully appreciated. I've been working
on this for weeks and keep running into one problem after another.
Thanks a million in advance.
Sincerely,
Graham A. KerbyIf it were me I would use the MySQL JDBC driver and not ODBC. Then DSN versus not-DSN wouldn't be an issue.
-
Can't connect a servlet to a mysql database (jdbc)
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.sql.*;
public class LoginServletJDBC extends HttpServlet{
public void doGet(HttpServletRequest request,HttpServletResponse response)
throws ServletException,IOException{
sendLoginForm(response,false); }
public void sendLoginForm(HttpServletResponse response,boolean error)
throws ServletException,IOException{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<html><head>");
out.println("<title>Login</title>");
out.println("</head>");
out.println("<body>");
out.println("<center>");
if(error)
out.println("<b>Failed login. Please try again</b>");
out.println("<br><br>");
out.println("<h2>Login page</h2>");
out.println("<br>Please enter your username and password");
out.println("<br><br>");
out.println("<form method=post>");
out.println("<table>");
out.println("<tr>");
out.println("<td>Username : </td>");
out.println("<td><input type=text name=userName></td>");
out.println("</tr>");
out.println("<tr>");
out.println("<td>Password : </td>");
out.println("<td><input type=password name=password></td>");
out.println("</tr>");
out.println("<tr>");
out.println("<td align=right colspan=3>");
out.println("<input type=submit value=Login></td>");
out.println("</tr>");
out.println("</table>");
out.println("</form>");
out.println("</center>");
out.println("</body></html>");
public void doPost(HttpServletRequest request,HttpServletResponse response)
throws ServletException,IOException{
String userName = request.getParameter("userName");
String password = request.getParameter("password");
if(login(userName,password)){
RequestDispatcher rd = request.getRequestDispatcher("AnotherServlet");
rd.forward(request,response);
else{
sendLoginForm(response,true);
boolean login(String userName,String password){
try{
String url = "jdbc:mysql://localhost:3306/Users";
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection(url,"root","");
//System.out.println("got connection");
Statement s = con.createStatement();
String sql = "select userName from Users where userName='"+userName+"and password='"+password+"';";
ResultSet rs = s.executeQuery(sql);
if(rs.next()){
rs.close();
s.close();
con.close();
return true;
rs.close();
s.close();
con.close();
catch(ClassNotFoundException e){
System.out.println(e.toString());
catch(SQLException e){
System.out.println(e.toString());
catch(Exception e){
System.out.println(e.toString());
return false;
}so ...
here i'm trying to connect to Users mysql database (i use Tomcat 4.1 and mysql servers and clients 4.0.1-alpha)
where is the problem ? when i run this servlet (http://localhost:8080/example/servlet/LoginServletJDBC ) it works ;
BUT when i type an username and a password (any user&pass) my servlet doesn't connect to the database (become a infinite loop without output ; i mean no any errors and exceptions)
i try other think : i changed the database with unexisting database and the result was that i was expected (Unknow database 'unexistingdatabase' )
what i miss ?
please... can anyone help me...
thank`s in advanceThe wireless security setting that the Actiontec modem/router is using may be different...and not compatible....than the setting that the Comcast product was using.
If you think that might the case, and you have the time to troubleshoot......
Temporarily, turn off the wireless security on the Actiontec modem/router
Reset an AirPort Express back to default settings, then see if it will connect using no security and allow an Internet connection when you do the Ethernet port test in the post above again.
If the AirPort Express cannot connect correctly using no security on the wireless network.....then it is a no brainer to know that it will never connect when security is enabled. So, if the AirPort will not connect using no security, you may have an incompatibility issue between the Actiontec and Apple products.
However, if the AirPort Express connects OK with no security, then this tells you that you will need to use a different setting for security on the Actiontec...the same that the Comcast router was using before.....so the Express will have a better chance of connecting.
That setting would be something like WPA/WPA2 Personal, or the same setting stated another way would be WPA-PSK-TKIP. -
Access to MySql Database in the Web Service
Hi all,
In my j2me web service project, i want to access to MySql database in the web service and
my installation is
Tomcat 5.0 for Java WSDP,
Java Web Services Developer Pack 1.5,
MySql Server 5.0 and environment variables are adjusted...
server.xml where is in "C:\tomcat50-jwsdp\conf" is adjusted like this
<!-- Replace the above Realm with one of the following to get a Realm
stored in a database and accessed via JDBC -->
<Realm className="org.apache.catalina.realm.JDBCRealm"
debug="99"
driverName="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://localhost:3306/erendb"
connectionName="root"
connectionPassword=""
/>
but i have not access to MySql database in the web service yet...
please help...Hi Luis,
If you see closely, the productID is actually a concatenation of the areaID and the productID. The reasoning here is that a product can be in multiple nodes of the product catalog and one would need to specify the product on a particular node for the direct URL to work.
On a client site, we came up with a better solution by creating a new FM to retrieve the specific areaID and productID for a product. This FM could be called by extending the webshop. Then a .NET program was written to re-direct a shortened form of the URL to the long URL and therefore the specific product in the product catalog. Eg.: http://yyyyy.com/b2c/b2c/product would be automatically redirected to http://yyyyy.com/b2c/b2c/init.do?shop=<shop name>&areaID=<area Guid>&productID=<product Guid>, something similar to the concept behind "tinyurl.com". A point to remember here is that this would work only for the B2C webshop.
Hope this helps.
Cheers,
Ashok. -
Problem with inserting data into mySQL database with jsp
I have a jsp page that collects infromation about a users vehicle and puts the data into a mySQL database. Iv'e been messing around with it for ages & i can't seem to get it to work even though i cannot see anything wrong with the code, which can be seen below.
<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
<%@ include file="Connections/connection.jsp" %>
<%
// *** Restrict Access To Page: Grant or deny access to this page
String MM_authorizedUsers="";
String MM_authFailedURL="login_form.jsp";
boolean MM_grantAccess=false;
if (session.getValue("MM_Username") != null && !session.getValue("MM_Username").equals("")) {
if (true || (session.getValue("MM_UserAuthorization")=="") ||
(MM_authorizedUsers.indexOf((String)session.getValue("MM_UserAuthorization")) >=0)) {
MM_grantAccess = true;
if (!MM_grantAccess) {
String MM_qsChar = "?";
if (MM_authFailedURL.indexOf("?") >= 0) MM_qsChar = "&";
String MM_referrer = request.getRequestURI();
if (request.getQueryString() != null) MM_referrer = MM_referrer + "?" + request.getQueryString();
MM_authFailedURL = MM_authFailedURL + MM_qsChar + "accessdenied=" + java.net.URLEncoder.encode(MM_referrer);
response.sendRedirect(response.encodeRedirectURL(MM_authFailedURL));
return;
String vehicle_details__registration = null;
if(request.getParameter("txt_registration") != null){ vehicle_details__registration = (String)request.getParameter("txt_registration");}
String vehicle_details__make = null;
if(request.getParameter("txt_make") != null){ vehicle_details__make = (String)request.getParameter("txt_make");}
String vehicle_details__model = null;
if(request.getParameter("txt_model") != null){ vehicle_details__model = (String)request.getParameter("txt_model");}
String vehicle_details__colour = null;
if(request.getParameter("txt_colour") != null){ vehicle_details__colour = (String)request.getParameter("txt_colour");}
String vehicle_details__tax_class = null;
if(request.getParameter("select_tax_class") != null){ vehicle_details__tax_class = (String)request.getParameter("select_tax_class");}
String vehicle_details__chasis_num = null;
if(request.getParameter("chasis_num") != null){ vehicle_details__chasis_num = (String)request.getParameter("chasis_num");}
String vehicle_details__status = null;
if(request.getParameter("radio_status") != null){ vehicle_details__status = (String)request.getParameter("radio_status");}
String owner_details__MMColParam = "1";
if (session.getValue("MM_Username") !=null) {owner_details__MMColParam = (String)session.getValue("MM_Username");}
Driver Drivervehicle_details = (Driver)Class.forName(MM_connection_DRIVER).newInstance();
Connection Connvehicle_details = DriverManager.getConnection(MM_connection_STRING,MM_connection_USERNAME,MM_connection_PASSWORD);
PreparedStatement vehicle_details = Connvehicle_details.prepareStatement("INSERT INTO vehicle_man_db.vehicle_details (registartion, make, model, colour, tax_class, chasis_num) VALUES ('"+ String vehicle_details__registration + "', '"+ String vehicle_details__make + "', '"+ String vehicle_details__model + "', '"+ String vehicle_details__colour + "', '"+ String vehicle_details__tax_class + "', '"+ String vehicle_details__chasis_num + "', '"+ String vehicle_details__status + "')");
vehicle_details.executeUpdate();
%>
<form name="add_vehicle_form" id="add_vehicle_form">
<p>Registration mark:
<input name="txt_registration" type="text" id="txt_registration">
</p>
<p>Make:
<input name="txt_make" type="text" id="txt_make">
</p>
<p>Model:
<input name="txt_model" type="text" id="txt_model">
</p>
<p>Colour:
<input name="txt_colour" type="text" id="txt_colour">
</p>
<p>Tax Class:
<select name="select_tax_class" id="select_tax_class">
<option value="AAA">Band AAA (up to 100g/km)</option>
<option value="AA">Band AA (101 - 120g/km)</option>
<option value="A">Band A (121 - 150g/km)</option>
<option value="B">Band B (151 - 165g/km)</option>
<option value="C">Band C (166 - 185g/km)</option>
<option value="D">Band D (Over 185g/km)</option>
</select>
</p>
<p>Chasis Number:
<input name="txt_chassis_num" type="text" id="txt_chassis_num">
</p>
<p>Status: active:
<input name="radio_status" type="radio" value="1" checked>
off-road
<input name="radio_status" type="radio" value="0">
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
<%
Connvehicle_details.close();
%>This is the error I am getting from the server
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 3 in the jsp file: /add_vehicle_form.jsp
Generated servlet error:
C:\Servers\Tomcat 5.0\work\Catalina\localhost\Assignment\org\apache\jsp\add_005fvehicle_005fform_jsp.java:113: ')' expected
PreparedStatement vehicle_details = Connvehicle_details.prepareStatement("INSERT INTO vehicle_man_db.vehicle_details (registartion, make, model, colour, tax_class, chasis_num) VALUES ('"+ String vehicle_details__registration + "', '"+ String vehicle_details__make + "', '"+ String vehicle_details__model + "', '"+ String vehicle_details__colour + "', '"+ String vehicle_details__tax_class + "', '"+ String vehicle_details__chasis_num + "', '"+ String vehicle_details__status + "')");
^
1 error
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:412)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
Any help would be much appreciated.
Thanksuse this ...
PreparedStatement vehicle_details =
Connvehicle_details.prepareStatement("INSERT INTO
vehicle_man_db.vehicle_details (registartion, make,
model, colour, tax_class, chasis_num) VALUES
vehicle_details .setString(1,String
vehicle_details__registration );
vehicle_details setString(2,String
vehicle_details__make );
vehicle_details .setString(3,String
vehicle_details__model );
vehicle_details .setString(4,vehicle_details__colour
vehicle_details .setString(5,String
vehicle_details__tax_class);
vehicle_details .setString(6,String
vehicle_details__chasis_num );
vehicle_details .executeQuery();Even you need a screwing up... what's the point putting that String inside. That's the bloody error. -
Problem with connection in Mysql database in struts application
Helllo
i've just started learning struts for my new project where i'm having problem in accessing mysql database
the datasource being defined in struts-config.xml is as follows:
<data-sources >
<data-source type="org.apache.tomcat.dbcp.dbcp.BasicDataSource">
<set-property property="driverClassName" value="com.mysql.jdbc.Driver" />
<set-property property="user" value="root" />
<set-property property="password" value="" />
<set-property property="minCount" value="" />
<set-property property="maxCount" value="" />
<set-property property="description" value="A" />
<set-property property="url" value="jdbc:mysql:///dnbotind_nbotdb" />
<set-property property="readOnly" value="false" />
<set-property property="autoCommit" value="true" />
<set-property property="loginTimeout" value="" />
</data-source>
</data-sources>as i run the application
it gives the errors HTTP status 404-Servlet action is not available
Thx in advancestudent-java wrote:
it gives the errors HTTP status 404-Servlet action is not availableThis is unrelated to the datasource configuration.
HTTP 404 is a "Page not found" error. The request URL is simply wrong. Either there's a typo in the URL, or there is a typo in the servlet mapping, or the servlet is not there where you think. -
I can't get my website to connect to mysql database hosted on my yahoo site
I used David Powers tutorials to build a CMS website in Dreamweaver using a testing site set up on my computer. I installed XAMPP and got it working on my computer. (I have a Windows 7 PC with Dreamweaver CS6)
Now I have installed the mysql database on my remote site following the instructions in the help section of Yahoo Small Business, where my website is hosted. I recreated the same database on the myPHPAdmin on my remote site. (If I understood what I found out when searching for a solution, Yahoo doesn't allow me to see the database from Dreamweaver. It seems that I have to make sure the connections are correct and then upload my site to the remote server. Then it should work once up)
Following the instructions I could find on Yahoo it seems that all I needed to do was make sure that the user name and password were the same as on my local computer and change the my Sql Server in the Server Connection in Dreamweaver CS6 to mysql instead of localhost, upload my website and it should connect. When I go to my webpage online I get "No database selected".
I know html, css, some php, and mysql.
I have been using Dreamweaver for approximatley 2 years and have created 2 successful websites for my husband, who is a photographer. He now wants to have a blog type news website and since I couldn't get Wordpress to do what he wanted to do I decided to create a CMS website. It works great on my computer, but now I need it to work on my remote site.
I know it's probably something really stupid that I have overlooked and I would really appreciate any help I could get.
I'm more than happy to learn whatever I need to learn to get this done. I have been searching all kinds of forums and I can find a lot of posts about this or a similar problem, but no solutions.
Please let me know if I need to provide more information.I'm sorry, the way I wrote that was confusing. In mysql it suggested you create a new user that had limited access to access each database you created, rather than use the root user which had all permissions. So in both the mysql on my computer and the mysql on my website I created a user with the same username and password, so that when my website was on my remote server the username and password were the same as when I was testing it on my local computer.
SnakEyez02 wrote:
Following the instructions I could find on Yahoo it seems that all I needed to do was make sure that the user name and password were the same as on my local computer and change the my Sql Server in the Server Connection in Dreamweaver CS6 to mysql instead of localhost, upload my website and it should connect. When I go to my webpage online I get "No database selected".
Just looking at that part of your response, I don't get what they are asking you. Typically the remote host will require that you update the username/password and possibly SQL server. When you are in most shared environments, which is what I presume you are in, you typically have a username that is prefix_username. So you should be updating your script to match that information, not the other way around. Also with the "mysql instead of localhost" comment, you would only change the script from localhost to another server (ip address) if the mySQL server is not on your web server. If you host tells you this is true thent he value should be an IP address instead of localhost. Is that the case?
For the second part of your question in the "Why can't I access my database" help on Yahoo it says "If your PHP or Perl configuration files require a host name, you may have a problem with your host name. Make sure that you are using the host name mysql, not the default host name localhost." I assumed that meant that in the setup menu when establishing a server connection I needed to replace "localhost" as the mysql Server with "mysql" and then upload my website. This didn't work. Since the mysql server I am trying to access can be accessed using phpmyadmin at www.mywebsite.com/phpmyadmin this seemed to make sense to me. I think I might have managed to access the mysql server, but I'm not choosing the database I want correctly. -
MySQL Database Connection (two databases at the same time)
I have never had to open more than one MySQL database from within the same website before, but I do now. The website I have is designed where all the content comes from within the main database. I am building an Inventory system that I want within it's own database, in the event I would ever need to move the application to another server or something, I don't want this data residing in the main database.
Currently, I open the database connection from within a file called "common.php" that resides in a directory called "lib" that can be accessed from the root directory. Below is the proposed code that would be placed within the "common.php" file:
// Define Database Variables
$dbserver = "127.0.0.1";
$dbuser = array('clevelan_user1', 'clevelan_user2');
$dbpass = array('P@ssw0rd', 'P@ssw0rd2');
$dbname = array('clevelan_database1', 'clevelan_database2');
// Start Session
session_start();
// Connect to Databases
connectdb($dbserver, $dbuser[0], $dbpass[0], $dbname[0]);
connectdb2($dbserver, $dbuser[1], $dbpass[1], $dbname[1]);
// Database 1 Connection
function connectdb($dbserver, $dbuser, $dbpass, $dbname) {
// connects to db
global $connection;
$connection = @mysql_connect($dbserver, $dbuser, $dbpass) or die ("could not connect to server");
$db = @mysql_select_db($dbname, $connection) or die ("could not select databsase");
return $connection;
// Database 2 Connection
function connectdb2($dbserver, $dbuser, $dbpass, $dbname) {
// connects to db
global $connection2;
$connection2 = @mysql_connect($dbserver, $dbuser, $dbpass) or die ("could not connect to server");
$db2 = @mysql_select_db($dbname, $connection2) or die ("could not select databsase");
return $connection2;
//End of Code Within the "common.php"
From within any page of the website, I want to access both connections by placing an include at the top of each page:
include_once("lib/common.php");
Currently, when I run the code above, any page within the website (the home page) provides error messages with regards to database connectivity (the pages are looking for there content from within the second database. It's as if the second database is the only database seen by the website.
I need help figuring out how I can have two MySQL databases open at the same time (the second database will only be open for short periods of time and then closed). But the main database is always open.Create one project using one copy of the exact tables.
create 2 different sessions.xml files each pointing to the same project. Set the login information in the sessions.xml files.
That should work fine.
Peter -
How to get the data from mysql database which is being accessed by a PHP application and process the data locally in adobe air application and finally commit the changes back in to mysql database through the PHP application.
If the data is on a remote server (for example, PHP running on a web server, talking to a MySQL server) then you do this in an AIR application the same way you would do it with any Flex application (or ajax application, if you're building your AIR app in HTML/JS).
That's a broad answer, but in fact there are lots of ways to communicate between Flex and PHP. The most common and best in most cases is to use AMFPHP (http://amfphp.org/) or the new ZEND AMF support in the Zend Framework.
This page is a good starting point for learning about Flex and PHP communication:
http://www.adobe.com/devnet/flex/flex_php.html
Also, in Flash Builder 4 they've added a lot of remote-data-connection functionality, including a lot that's designed for PHP. Take a look at the Flash Builder 4 public beta for more on that: http://labs.adobe.com/technologies/flashbuilder4/ -
How to get data into the mySQL database?
First some background.
I have a website that has outgrown its designed dimensions and is a huge burden to maintain. See PPBM5 Benchmark
There is a lot of maintenance work involved, so I'm investigating a PHP/MySQL approach to easen the burden and to add functionality to the site. With the current Excel based structure and over 420 entries, it is cumbersome for me to maintain, but also for users to find what they need.
A MySQL based dynamic structure is a lot easier and offers vastly more selection capabilities, like selecting only records that meet specific criteria.
Data submission is done with a form, that contains most of the relevant data, but the drawack is that people submitting their data are often not technically inclined, give wrong answers due to a lack of understanding or making typo's. The test results are attached in one or two separate .txt files, but often they have not read the instructions correctly or did something wrong, so these attached .txt files can not be trusted automatically, they have to be checked before inclusion.
These were my initial thoughts:
1. Data collection:
To avoid spending all our energy and time on correcting typo's, getting missing data, correcting errors, I am investigating the use of CPU-Z in Ghost mode to create a .txt or .html file that contains all relevant hardware info we need and even more. It gives all the info we currently have, but adds data like number of memory sticks, DDR timings, stock clock speed and BCLK setting, video card info and VRAM size, etc.
To see what I mean, run CPU-Z, go to the About tab and press the Save Report button and look at the results.
This can all be done without user intervention in an automatic way, but maybe I need to add an Auto-It file to the test to make it all run as desired.
If this works and I'm able to extract the relevant data from the created file and can insert it into the database, we may be in business for the next version of PPBM5.5 or PPBM6. It does require a modification to the instructions, making them a lot easier, because there is less data to fill out.
2. Data submission:
The submission form can be simplified if the CPU-Z data can be used. We have to create an automatic way to attach the created .html file from CPU-Z to the submission form and we have to streamline the Output.txt and Output-MPE.txt files to be more easily included in the 'form.lib.php' file. It currently is manual labor and very time consuming.
3. Adding to Database:
I have to find a way to create database records from the Gmail forms I receive. All incoming mail messages need to be checked on relevancy and if relevant, need to be added automatically to the database and then offered for approval before final inclusion in the database. Data included in the database will then include submission date and time, Email address, IP address used, plus links to the files submitted and available on the website.
4. Publication of the database:
After approval of new records from step 3, all updates will be automatically applied to the database and accessible for users. I do not yet intend to introduce a user account , requesting login before all functionality is accessible. Too much trouble and administration.
Queries should be possible on things like CPU (check box), so include 17-920, i7-930, i7-950 but exclude i7-980X and i7-990X, Size of memory (check box), Overclocked (boolean, yes, no), SSD as OS disk, and similar options.
The biggest problem is to keep the color grading and statistical indicators (Top, D9, Q3, Med, Q1 and D1) intact on dynamically generated queries. Say you make a query which results in 20 observations, this should show the related colors and legends. Next query results in 48 observations and of course the color grading and legends do need to reflect that. Question in my mind, does the RPI remain constant, independent of the query or does that need to be recalculated on the basis of the query?
Next thing is to allow a user to select a specific observation and by simply clicking on it be shown, in a separate window (detail page) or accordion, all the CPU-Z related information about the hardware.
The graphs, Top-20 and MPE Gains, need to be dynamically adjusted, based on the query used.
5. Ideally, external links:
In an ideal situation, one could link the CPU-Z data to external price databases, looking up current prices for CPU, memory, video card, disks, raid controller, etc. to get instant BFTB charts, based on the query made. But that is the next step.
Situation now:
I have a MySQL database that is easily updated with the new submissions. Simply create a .CSV flie from the submitted forms and import that into the database. The bulk of the initial work is done.Lots remain to be done as you can see above, but that is for a later time.
Question:
I have this table, that needs to be filled with data in the submitted and attached files. Mr. X submitted his data and can be uniquely identified by his "Ref_ID". He attached one or two files in .TXT format with the relevant test data. These files are stored on the server with a concatenated name:
"Ref_ID","-","filename"
Say his Ref-ID is: 20110204-6cf5 and his submitted file is called: Output(99).txt then the file can be found on the server as
20110204-6cf5-Output(99).txt
I need to be able to open that comma delimited file, the contents may look like this: "439","1036","819","531" and insert these contents into the relevant record and fields.
Graphically,
is what I want to achieve.
This being my first exposure to PHP/MySQL, you can imagine I'm not clear on how to go from here.
Added complication is that I actually have 5 numbers to insert per record and two calculated fields, Total Score and RPI should be calculated fields. Haven't yet figured out how to handle calculated fields, maybe only in the PHP/HTML code and not in the database.
I hope someone can help me.You do have a very complex looking site and may need several tables in mysql to handle all that data. If you knew to phpmysql I would suggest taking a look at this tutorial it will help get you started in understanding how to $_GET info from a database and also how to $_POST data to a database. I am no expert just learning myself and I found this very helpful. This is the link http://www.adobe.com/devnet/dreamweaver/articles/first_dynamic_site_pt1.html
There are also many tutorials on Youtube to help build a CMS Content Management Site I would suggest the following: -
http://www.youtube.com/user/phpacademy
http://www.youtube.com/user/betterphp
http://www.youtube.com/user/flashbuilding
And many more on my channel here
http://www.youtube.com/user/Whisperingonthewind
CMS's are easier to maintain, add edit and delete content.
I have also recently bought a Book by David Powers Training from the Source very helpful.
Anyway hope you get it sorted. -
How to store file content in BLOB field MySql database using java
Hi!
i want to store the file content in a BLOB field in MySql database using java.
Please help me out..........
thanx in advance...
byei stored images in db, and retrieved them. like that cant i store pdf file in db, and retrieve it back using oracle db?
Plz help me out how to put a file in db. i need complete code. thanks in advance. -
What should i do with an Oracle 11g Database, MySQL database and a dump file.
I just joining to a new work field, almost about a database and i know "NOTHING" about this field.
My company has a system that running by Oracle Database, the problem is that Oracle Database will cost a lot of money when my company expands.
So the quest is converting Oracle Database to MySQL database.
Of course i cant try to convert it in the main Database, so i create one Oracle 11g Database on my LocalHost, and it already actived in " Localhost:1158 " etc.
I have another Sever test that already set up MySQL database, and a dump file from the system.
So I want to ask these 2 questions :
1. How to create an new Oracle Database from that dump file ?
2. Is it alright if i use tool to convert Oracle Database into MySql, or i should do it manually ?
Thanks alot.I just joining to a new work field, almost about a database and i know "NOTHING" about this field.
My company has a system that running by Oracle Database, the problem is that Oracle Database will cost a lot of money when my company expands.
So the quest is converting Oracle Database to MySQL database.
I predict that converting to MySQL will cost your company more as it expands. As you expand managing contention becomes more important - Oracle does this for you. I do not think MySQL does, so you'll have to write more code to deal with this, costing the company money. A big part of making application scalable and reliable is to use stored procedures, how good are MySQL's compared to PL/SQL's. What other features are there that MySQL has that will benefit your company that Oracle doesn't. What do you need to think about as your company expands that need to be taken care of in the database. I would have thought a migration from MySQL to Oracle would be more common to deal with expansion.
As you know "NOTHING" you need to think about what each database can give you for the next 10 years to cope with you businesses potential requirements, and extimate how much it will cost to implement these requirements, then make the decision
Maybe you are looking for
-
Sound Issue Windows 7 on iMac mid-2007
I am having trouble getting my audio to work on Windows 7 on my mid-2007 20" iMac. I do not have the drivers for this. I had Windows 7 installed by a friend of mine and I did not notice the audio was not working till today. Does anyone know where
-
I seem to have fried my iPad 1
Actually it's my wife's iPad that I seem to have fried ..... Whilst syncing to her MacBookPro, the iPad got into a weird loop where it kept asking if I wanted to transfer the purchases made on the iPad to iTunes, I'd say yes, it would go away and do
-
I want to check the main diffrence in Pop up block enabled and disabled.But,i don't get any difference.Would u please help me to understand the difference using one practical example of website
-
WM6 Windows Live Messenger contacts problem
When I sign onto Windows Live Messenger with my Palm 750 WM6, my contact list shows Online(0), Offline(0). I can't send IM to anybody on my contacts unless somebody started a conversation for me to reply to. Does anyone has this problem? TIA Post rel
-
Hey I just don't understand why I can't get my songs to carry their artwork from my iTunes library to my iPod. Its great that we don't get that error 50 message anymore when disconnecting the iPod and checking the box from artwork, but even when it i