Dreamweaver8, MySQL....
Hey guys i need your help please, i'm in a bit of confused.
I'm building a vehicle rental system and I have created a database
using MySQL that i'm successfully connecting to through dreamweaver
8
I have the following at the moment :
select Location (list/menu)
Rental Length(Days) (text field)
select Vehicle category (list/menu)
(Submit)
Quotation Result (See question below)
1-Locations are in the database and i can access database
without problems
2-Rental length is where a user enters number of days(NB
there's no field in database associated with this)
3-Vehicle categories are stored in the database and they are
A-E and within the same table i've got a Daily rate field where
i've different rates for each category eg A=$40, B=55 etc
Now my problem:
Through dreamweaver8 How can make the quotation result
display when user presses submit button.
The result should be category's daily rate * number of days
entered.
Please Help!!
Hi,
a multiplication of both fields as such is fortunately quite
easy to achieve -- on the next page insert the following PHP
snippet somewhere on top:
<?php
// multiply vehicle_category * rental_length
$a = $_POST['vehicle_category'];
$b = $_POST['rental_length'];
$result = $a * $b;
?>
and later "echo" the result like this:
Result: <?php echo $result; ?> USD
This will of course only work when the "value" parameters of
your "vehicle_category" menu are actually passing numbers (e.g. 40)
-- if this menu is passing the values A-E instead, you´ll need
to define a separate query on the results - page like...
"SELECT vehicle_price FROM table_name WHERE
vehicle_category...." matches the received menu value (A-E).
In this case the variable $a mentioned above will need a
reference to the query, like :: $a = $queryname['vehicle_price'];
Does this help ?
Similar Messages
-
Connecting to MySQL in Dreamweaver8
Hey guys i've got Dreamweaver8 and wamp5 installed, my
problem is coming when i try to connect to MySQL through
Dreamweaver. I've followed through all Adobe tutorials including
the Blog tutorial but nothing seem to be working. My web server is
working fine so is my database , i know this because i've tried to
connect to the database using PHP command and it's working fine.
This is how i've defined my web site:
Local Info:
Website Name: MyWebSite
URL:
http://localhost/MyWebSite
Server Technology: PHP MySQL
How do you want to work with your files during development:
Edit and test locally(my testing server is on this computer.
Where on your computer do you want to store your files?
C:\wamp\www\MyWebSite
What URL would you use to browse to the root of your site?
http://localhost/MyWebSite
Copy to another machine: No
For Remote info Access i've put None.
NB Basic Site Definition
Please tell me where i'm getting it wrong because when i try
to make the connection, i believe my snag is at the testing server
but i've tried various paths.
Connection Name: Myconn
MySQL Server: localhost
User: Username
Password: mypassword
When i try to select the database i'm getting the
unidentified error message 404 which suggests possible causes of
connection failure to paths etc.
Please help me i've worked the whole week hoping for a
breakthrough and have tried all sorts of different techniques
suggested by others on forums and websites to no avail.
Does dreamweaver have limitations with PHP/MySQL or is there
something that i'm missing.
RamsonRamsTheDon wrote:
> Thanks David for the suggestions, I think i can almost
rule the firewall out as i've disabled it, that leaves the wamp
port.
> How do i tell wamp5 to use port 3306? I'm kinda novice.
I don't know. I have never used wamp5. I install Apache, PHP,
and MySQL
independently. A lot of the so-called "simple all-in-one
solutions" have
non-standard settings, so you need to ask in a wamp5 support
area.
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/ -
Running MySQL Connection for PHP on Dreamweaver8
Good Day:
I installed the MySQL 5.0 and PHP 5.0 to run on my Dreamweaver 8.
On the Application Panel -> Database tabs -> MySQL Connection: after i entered the connection name, user name and everything, it returns HTTP ERROR CODE 502 BAD GATEWAY.
btw, I'm running on localhost
May someone pls tell me what's wrong with it?
many thanks!Hi,
maybe your issue is related to what´s already been posted to the Dreamweaver Application Development forums:
http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=12&catid=263&threadid =1293443&enterthread=y
Günter Schenk
Adobe Community Expert, Dreamweaver -
Login failure (cannot modify header) PHP/MySQL
I have a login form 100% Dreamweaver8 built using PHP/MySQL.
After logging in it fails to goto the $MM_redirectLoginSuccess page
(index.php). I did not have this issue prior to the 8.02 update. I
designed it the same way as I had before the 8.02 update. I have
checked multiple times for whitespace before and after the PHP open
and close tags in Dreamweaver and other text editors.
Below is what info is needed I hope.
Error
PHP Warning: Cannot modify header information - headers
already sent by (output started at /var/www/web4/web/login.php:4)
in /var/www/web4/web/login.php on line 72, referer:
Code (All Dreamweaver 8 Generated)
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
session_start();
$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
$_SESSION['PrevUrl'] = $_GET['accesscheck'];
if (isset($_POST['username'])) {
$loginUsername=$_POST['username'];
$password=$_POST['password'];
$MM_fldUserAuthorization = "Account_Type";
$MM_redirectLoginSuccess = "index.php";
$MM_redirectLoginFailed = "loginfailed.php";
$MM_redirecttoReferrer = false;
mysql_select_db($database_dnsturtle, $dnsturtle);
$LoginRS__query=sprintf("SELECT Email, Password,
Account_Type FROM accounts WHERE Email=%s AND Password=%s",
GetSQLValueString($loginUsername, "text"),
GetSQLValueString($password, "text"));
$LoginRS = mysql_query($LoginRS__query, $dnsturtle) or
die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = mysql_result($LoginRS,0,'Account_Type');
//declare two session variables and assign them
$_SESSION['MM_Username'] = $loginUsername;
$_SESSION['MM_UserGroup'] = $loginStrGroup;
if (isset($_SESSION['PrevUrl']) && false) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
header("Location: " . $MM_redirectLoginSuccess );
--------------------Line 72
else {
header("Location: ". $MM_redirectLoginFailed );
?>I take it you have an include file as well on the page, to
reference the
database? Check in there for whitespace.
Gareth
http://www.phploginsuite.co.uk/
PHP Login Suite V2 - 34 Server Behaviors to build a complete
Login system. -
MySQL SERVER NOT FOUND ERROR 404
Having talked to as many people as should know, NOBODY seems
to have a clear answer to the fact that from Dreamweaver 8 there is
a serious connectivity issue to MySQL databases in PHP server. I'm
using Easy PHP.
I begin to wonder if the makers of Dreamweaver8 intended to
give us all a Jigsaw puzzle. This Problem Error 404 not being able
to find the PHP@MySQL server/database is getting increasingly
ridiculous that I might begin to suggest that people never buy
Dreamweaver8 as it is more trouble than any good. How can Adobe sit
bag and let us keep going through this stress?
How does one determine a more uptodate library when you have
just installed the latest version of Dreamweaver 8 and
EasyPHPserver? You still keep getting the error message that it
cannot find MMHTTPDB which is sitting clearly in the appropriate
folders!!
In the previous versions, it was straight forward on IIS to
set up a DSN and just connect to the Database. Why has it become
impossible to connect to a straightforward and existent database?
I am disappointed with Adobe amd Dreamweaver makers! I've
over stressed myself trying to get this problem solved.
Help Pleeeease!!!IfyO wrote:
> Having talked to as many people as should know, NOBODY
seems to have a clear
> answer to the fact that from Dreamweaver 8 there is a
serious connectivity
> issue to MySQL databases in PHP server.
There is not a serious connectivity issue. It works perfectly
on
correctly configured system. I have given you a full response
in your
duplicate post in the "Can't connect to MySQL" thread.
David Powers
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "Foundation PHP 5 for Flash" (friends of ED)
http://foundationphp.com/ -
Using MySql and PHP with Dreamweaver on a Mac
Hello all,
As always if the answers to these questions are obscenely
obvious please humour me.
I use XHTML and CSS in my websites and realise that it is
time that I dabbled with SSI. So I've started using PHP.
However, I have been following the installation directions of
MySql and am running into problems. I am installing the relavent
software and am then unable to find it on my Mac, the startup files
are there but the actual MySql data appears to not be installed
despite my computer telling me it is...... I am using a G3 running
OSX 10.4 is this good enough? I noticed talk of needing a PowerPC
or Intel mac. Is this the case?
Also, would I need MySql installed on my actual computer if
the my servers have it already? And does Dreamweaver 8 have both of
these programs installed as standard?
If you could help out I would be very appreciative as I would
like to learn this stuff and I appear to be struggling at the
outset....
Cheers
M.AM.A.Wilson wrote:
> However, I have been following the installation
directions of MySql and am
> running into problems. I am installing the relavent
software and am then unable
> to find it on my Mac, the startup files are there but
the actual MySql data
> appears to not be installed despite my computer telling
me it is...... I am
> using a G3 running OSX 10.4 is this good enough? I
noticed talk of needing a
> PowerPC or Intel mac. Is this the case?
MySQL is a relational database management system that
comprises a
database server and several utility programs. Although you
install it
like any other program on a Mac, the similarity stops there.
First, the point about PowerPC and Intel Macs is that there
are
different versions of the MySQL installer for each type of
processor.
I'm pretty sure that a G3 is OK, but you must choose the
PowerPC version
of MySQL, not the 64-bit or x86 (Intel Mac) version.
Once you have installed MySQL, you need to drag the
MySQL.PrefPane icon
from the disk image onto your System Preferences. This
installs a
Preference Pane that enables you to start and stop MySQL. The
Preference
Pane has an option to start up MySQL automatically, but in my
experience, it doesn't work on Tiger. You need to open the
Preference
Pane, and click Start MySQL Server each time you start your
computer.
The best way to work with MySQL is to use a graphical
interface, such as
phpMyAdmin. As Osgood has mentioned, I have written a book
about PHP and
Dreamweaver, which goes into all the necessary details. It's
also very
Mac-friendly with separate instructions where necessary for
PC and Mac.
More details here:
http://foundationphp.com/dreamweaver8/
David Powers
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "Foundation PHP 5 for Flash" (friends of ED)
http://foundationphp.com/ -
I am so far out on the limb of my techno capability that if I
even think of leaning forward I will fall into the abyss.
Am using Dreamweaver MX 2004 to create PHP
view/add/update/delete forms to connect to a MySQL 5.0 database
hosted by HotZona.com. Use PhpMyAdmin to set up and define the
tables (about 20 tables). All of the work I have done so far has
been done inside of Dreamweaver MX 2004. Have not modified or
inserted any original code in any of the Php files generated so
far.
Have been able to setup view/add/update/delete forms for each
table. That took me some time and a major learning curve. Oh, and
that was after spending a month figuring out what happened to the
DW connection to the MySQL database.
Some of the tables are lists to be used as lists in other
tables. That is where I am now stumped.
I can set up (useing DW) an add form for a table that uses
another table for a list in one field. It shows properly in the add
form. But, when you look in the table using PhpMyAdmin, the field
in the table does not contain the value of the list item selected.
I've made a couple more changes so I may have licked this one.
But, I cannot figure out how to use DW to pull up the
sub-list value in vew, update or delete forms. Any suggestions on
how to do this in DW or do I have to write the code independent of
DW?
Any suggestions?
Thanks
Mike Gareyhi ,
you can always try the macromedia devnet sites , they have
ongoing tutorials and discussions on all areas, including php with
dreamweaver8.
http://www.adobe.com/devnet/topics/php.html
be aware though that some of the tutorials require the use of
third party php extensions, like interakt products, which is a
shame because most of them are expensive to buy. But they are still
worth a read.
hope this is some help.
ted. -
Dreamweaver PHP/mySQL poll problem?
Hi,
I'm a PHP/mySQL noob who's using some of Dreamweaver's 8
(8.2) out-of-box Update server behaviors to update a database of
results for a poll. I know there's a lot of free polling apps out
there but I need to have the poll show up in another page as
opposed to being refreshed/displayed in the same page/content area.
I've successfully built the backend in phpMyAdmin and I'm
able to list the database contents and do basic updates to the poll
questions and answers. However, I've been unable to pass an
incremented result value via a Dreamweaver radio button group
(which is the normal poll format) without previous unselected
results being overwritten.
When an answer is selected the result is indeed incremented
and is displayed in the Result Listing but unfortunately it also
overwrites any preexisting data for that poll and replaces it with
zero. For example:
Question:
Answer a) 0
Answer b) 0
Answer c) 1 (this would be the value that was selected)
Answer d) 0
If c is selected again the value is stored and incremented
and the value is now 2. However, if that value is not selected,
then another value is incremented and c would be wiped. I've even
resorted to trying to use javascript to maintain the original state
but to no avail I was just previously incrementing the inline php
radio button value and/or assigning different names to each of the
radio buttons. This, of course, allows people to select multiple
values which runs contrary to the whole idea behind radio buttons,
but I thought I'd see if that worked . Anyway, when the radio group
is assigned the same value it merely increments everything.
example:
http://www.dailydatum.com/funFacts/funFactsListingSingleUpdate15.php
As you can see, i'm up to version 15 and gritting me teeth,
lol. Any help would be mighty appreciated.
Mariohi ,
you can always try the macromedia devnet sites , they have
ongoing tutorials and discussions on all areas, including php with
dreamweaver8.
http://www.adobe.com/devnet/topics/php.html
be aware though that some of the tutorials require the use of
third party php extensions, like interakt products, which is a
shame because most of them are expensive to buy. But they are still
worth a read.
hope this is some help.
ted. -
Hi all:
I've set up a LAMP (Linux-Apache-MySQL-PHP of course) server
and I'm getting the good old unidentified error when trying to
connect. The Adobe technote gives a number of seemingly ambiguous
reasons why this can happen. Has anyone else encountered this
problem and if so what is the most common cause? I have a user set
up for Dreamweaver in the MySQL database and I can connect wtih an
admin program from the same computer. The error occurs just as I
click test on the add connection dialog. I can supply more info but
I'm so new at this I don't even know what's important. Any help
would be greatly appreciated.
Thanks!
Ken Ha QuadIfyO wrote:
> I begin to wonder if the makers of Dreamweaver8 intended
to give
> us all a Jigsaw puzzle.
No, the makers of Dreamweaver give you software that works
correctly
with a properly configured setup.
> How can Adobe sit bag and let us keep going through this
stress?
I agree that the setup documentation could be clearer, but
most of the
problems that I've encountered are the result of incorrect
installation
of PHP/MySQL. That's not Adobe's responsibility. The other
main source
of problems is failure to define a testing server correctly
in the
Dreamweaver site setup.
> Following your suggestion, how does one determine a more
uptodate library when
> you have just installed the latest version of
Dreamweaver 8 and EasyPHPserver?
Dreamweaver 8 relies on a correctly configured installation
of PHP and
MySQL. It installs nothing that affects the performance of
PHP or MySQL.
Part of your problem may lie in using EasyPHP. I've just
visited the
EasyPHP site, and see that the latest version of EasyPHP uses
PHP
4.3.10, MySQL 4.1.9, and phpMyAdmin 2.6.1. The latest "real"
versions
are PHP 5.1.4, MySQL 5.0.22, and phpMyAdmin 2.8.
There is a warning in the PHP manual that none of the
"all-in-one"
packages are endorsed by php.net. The fact that EasyPHP can't
be
bothered to update to more recent versions is one reason you
shouldn't
rely on such packages.
> You still keep getting the error message that it cannot
find MMHTTPDB which is
> sitting clearly in the appropriate folders!!
If it were sitting in the appropriate folder, Dreamweaver
would find it.
It sounds as though you haven't defined your testing server
correctly.
To start off with, the site files must be in the Apache
server root. In
the testing server definition, enter the location of the
files in
testing server folder, and the correct URL in URL prefix.
On my setup, the Apache server root is C:\htdocs. So the
correct
settings for a site called "mysite" is as follows:
Server model: PHP MySQL
Access: Local/network
Testing server folder: C:\htdocs\mysite\
URL prefix:
http://localhost/mysite/
However, you may still have problems connecting to MySQL with
EasyPHP,
because it uses PHP 4.3 in combination with MySQL 4.1. You
may need to
set up your MySQL passwords using the OLD_PASSWORD protocol:
http://dev.mysql.com/doc/refman/5.0/en/old-client.html
David Powers
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "Foundation PHP 5 for Flash" (friends of ED)
http://foundationphp.com/ -
Hi can anyone point me in the right direction of a good PHP
and MySQL tutorial, particularly for creating login pages?
ThanksStefan_Lesik wrote:
> Hi can anyone point me in the right direction of a good
PHP and MySQL tutorial, particularly for creating login pages?
Thanks
I don't know of a free one on the internet, but you might be
interested
in looking at my book, "Foundation PHP for Dreamweaver 8",
which covers
all DW server behaviors, including user authentication.
http://foundationphp.com/dreamweaver8/
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/ -
Can not get PK-FK in meta-Data of MySql....Help me pls.
Hello Every one.
I can not to get the PK and FK from Meta-Data Database of mysql-4.1.1a-alpha. Anyway I tried to do the
followihg
1. OS windows 2000 Pro.
2. set configuration Script support InnoDB Table Type as the follow in my.ini file.
[mysqld-nt]
innodb_data_home_dir = C:\mysql\data
innodb_data_file_path =\ibdata\ibdata1:2000M // in folder \data\ i was created folder ibdata
3. I try to create data as reference in example java code and table :persons , shirt as the example in
Create innodb table Type of mysql doc.
4. the code test as following
In the test code i can get the result only from method : getPrimarykey(...); only and the other method ,getExportedKeys, getImportedKey , getCrossReference the result in ResultSet is null.
anyway, this code i can apply in the oracle db with change db driver .
I wish the answer why? and the actually the second parameter of this parameter , as refer scheme name , the scheme name is ?
Thank you
import java.sql.*;
public class testMeta {
public testMeta() {
ResultSet rs=null;
String url = "jdbc:mysql://localhost:3306/testinnodb";
Connection con = null;
try{
Class.forName("org.gjt.mm.mysql.Driver");
}catch(ClassNotFoundException ex){
System.out.println(ex.getMessage());
try{
con = DriverManager.getConnection(url,"root","rootpwd");
prtS("getConnection complete");
DatabaseMetaData metaData = con.getMetaData();
Connection con2 = metaData.getConnection();
String type[] = new String[1];
type[0] = new String();
prtS("*************** GET Schemas ***************");
rs = metaData.getSchemas();
while(rs.next()){
System.out.println("12345");
prtS("TABLE_CAT" + " : " + rs.getString(0));
prtS("TABLE_CAT" + " : " + rs.getString("TABLE_SCHEM "));
rs=null;
prtS("*************** GET PRIMARY KEYS ***************");
rs = metaData.getPrimaryKeys(con.getCatalog(),null,"persons");
while(rs.next()){
prtS("TABLE_CAT" + " : " + rs.getString("TABLE_CAT"));
prtS("TABLE_SCHEM" + " : " + rs.getString("TABLE_SCHEM"));
prtS("TABLE_NAME" + " : " + rs.getString("TABLE_NAME"));
prtS("COLUMN_NAME" + " : " + rs.getString("COLUMN_NAME"));
prtS("KEY_SEQ" + " : " + rs.getString("KEY_SEQ"));
prtS("PK_NAME" + " : " + rs.getString("PK_NAME"));
rs=null;
prtS("*************** GET Exported KEYS ***************");
rs = metaData.getExportedKeys(con.getCatalog(),null,"shirt");
while(rs.next()){
prtS("FKCOLUMN_NAME" + " : " + rs.getString("FKCOLUMN_NAME"));
rs=null;
prtS("*************** GET Imported KEYS ***************");
rs = metaData.getImportedKeys(con.getCatalog(),null,"persons");
while(rs.next()){
prtS("PKTABLE_CAT" + " : " + rs.getString("PKTABLE_CAT"));
rs=null;
prtS("*************** GET CrossReference ***************");
rs = metaData.getCrossReference(con.getCatalog(),null,"persons",con.getCatalog(),null,"shirts");
while(rs.next()){
prtS("PKTABLE_CAT" + " : " + rs.getString("PKTABLE_CAT"));
}catch(SQLException ex){
prtS(ex.getMessage());How i know the jdbc driver not compatible to this
mechanismBy reading the documentation tthat comes with your driver. Recent versions of the MySQL JDBC driver do support the getExportedKeys/ImportegKeys methods but the table needs to be crated as InnoDB.
So run the SQL command
show table statusWhats under the Type column for your table? If it isn't InnoDB then this isn't going to work.
If it is InnoDB but getExportedKeys/ImportegKeys still don't work then you haven't used the "foreign key" constraint in your "create table" command -
Strange scenario,Oracle can not display the data in mysql correctly
I use Heterogeneous Service+ODBC to achieve "oracle access mysql"(any other method?),and now i find Oracle can not display the data in mysql correctly:
-------mysql------------
mysql> create table tst(id int,name varchar(10));
Query OK, 0 rows affected (0.00 sec)
mysql> insert into tst values(1,'a');
Query OK, 1 row affected (0.00 sec)
mysql> select * from tst;
------------+
| id | name |
------------+
| 1 | a |
------------+
1 row in set (0.00 sec)
mysql> show create table tst\G
*************************** 1. row ***************************
Table: tst
Create Table: CREATE TABLE `tst` (
`id` int(11) DEFAULT NULL,
`name` varchar(10) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8
1 row in set (0.00 sec)
-------------oracle ------------------
SQL> select count(*) from "tst"@mysql;
COUNT(*)
49
SQL> select * from "tst"@mysql;
id
1
SQL> desc "tst"@mysql;
Name Null? Type
id NUMBER(10)You can make the following query on the result page:
"select * from the_table where movietitle = ? and cinema = ?"
then you set movietitle and cinema to those which the user selected. If the resultset contains more than 0 rows, that means the movie is available.
Below is the sample code, it assumes you have a connection to the database:
PreparedStatement stat = myConnection.prepareStatement("select * from the_table where movietitle = ? and cinema = ?");
stat.setString(1, usersMovieTitleSelection);
stat.setString(2, usersCinemaSelection);
ResultSet res = stat.executeQuery();
if (res.next()) {
out.print("The movie is available");
} else {
out.print("The movie is not available");
}Now just add that to your JSP page. Enjoy ! =) -
How can I create a new table in a MySQL database in MVC 5
I have an MVC 5 app, which uses MySQL hosted in Azure as a data source. The point is that inside the database, I want to create a new table called "request". I have already activated migrations for my database in code. I also have the following
code in my app.
Request.cs: (inside Models folder)
public class Request
public int RequestID { get; set; }
[Required]
[Display(Name = "Request type")]
public string RequestType { get; set; }
Test.cshtml:
@model Workfly.Models.Request
ViewBag.Title = "Test";
<h2>@ViewBag.Title.</h2>
<h3>@ViewBag.Message</h3>
@using (Html.BeginForm("SaveAndShare", "Home", FormMethod.Post, new { enctype = "multipart/form-data" }))
@Html.AntiForgeryToken()
<h4>Create a new request.</h4>
<hr />
@Html.ValidationSummary("", new { @class = "text-danger" })
<div class="form-group">
@Html.LabelFor(m => m.RequestType, new { @class = "col-md-2 control-label" })
<div class="col-md-10">
@Html.TextBoxFor(m => m.RequestType, new { @class = "form-control", @id = "keywords-manual" })
</div>
</div>
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<input type="submit" class="btn btn-default" value="Submit!" />
</div>
</div>
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
HomeController.cs:
[HttpPost]
public ActionResult SaveAndShare(Request request)
if (ModelState.IsValid)
var req = new Request { RequestType = request.RequestType };
return RedirectToAction("Share");
The point is that, I want the user to fill the form inside the Test view and click submit, and when the submit is clicked, I want a new entry in the new table to be created. But first of course I need to create the table. Should I create it using SQL query
through MySQL workbench? If yes, then how can I connect the new table with my code? I guess I need some DB context but don't know how to do it. If someone can post some code example, I would be glad.
UPDATE:
I created a new class inside the Models folder and named it RequestContext.cs, and its contents can be found below:
public class RequestContext : DbContext
public DbSet<Request> Requests { get; set; }
Then, I did "Add-Migration Request", and "Update-Database" commands, but still nothing. Please also note that I have a MySqlInitializer class, which looks something like this:
public class MySqlInitializer : IDatabaseInitializer<ApplicationDbContext>
public void InitializeDatabase(ApplicationDbContext context)
if (!context.Database.Exists())
// if database did not exist before - create it
context.Database.Create();
else
// query to check if MigrationHistory table is present in the database
var migrationHistoryTableExists = ((IObjectContextAdapter)context).ObjectContext.ExecuteStoreQuery<int>(
string.Format(
"SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = '{0}' AND table_name = '__MigrationHistory'",
// if MigrationHistory table is not there (which is the case first time we run) - create it
if (migrationHistoryTableExists.FirstOrDefault() == 0)
context.Database.Delete();
context.Database.Create();Hello Toni,
Thanks for posting here.
Please refer the below mentioned links:
http://azure.microsoft.com/en-us/documentation/articles/web-sites-dotnet-deploy-aspnet-mvc-app-membership-oauth-sql-database/
http://social.msdn.microsoft.com/Forums/en-US/3a3584c4-f45f-4b00-b676-8d2e0f476026/tutorial-problem-deploy-a-secure-aspnet-mvc-5-app-with-membership-oauth-and-sql-database-to-a?forum=windowsazurewebsitespreview
I hope that helps.
Best Regards,
Sadiqh Ahmed -
Issue in bringing up CRS on ATG 10.1.1 with MySQL and Weblogic 10.3
Hello,
I am trying to bring up Commerce Reference Store as part of my evaluation using MySQL (bundled with ATG) and WebLogic 10.3.
I followed the ATG Documentation on CRS with WebLogic and MySQL and I could not proceed because of the below error log. I keep getting error in OnlineCreateServerInstanceTask of CIM. I believe it should be some configuration problem, but could not think of any.
As part of the installation, I use C:\jdk1.6.0_25. I verified my weblogic server is up through the admin console. I started MySQL before running the eval batch. Apart from starting MySQL server, I did not make any datasource/database configuration changes for ATG. I have not run any other scripts to configure MySQL too.
Please guide me to resolve the problem.
C:\ATG\ATG10.1.1\CommerceReferenceStore\Store\eval>configureEval.bat
Do you wish to run the CRS evaluation installation? [Y/N]: y
Do you wish to use an existing database for the CRS evaluation? [Y/N]: n
The CRS evaluation install will attempt to create the database. Press [Return] t
o continue or any other key to quit:
Enter mysql database connection details
Enter user name: admin
Enter user password: admin
Enter database name: crsprod
Enter 'root' user password:
Creating database...
Finished database creation
Enter weblogic admin server URL: http://localhost:7001
Enter weblogic admin server username: weblogic
Enter weblogic admin server password: weblogic123
Buildfile: C:\ATG\ATG10.1.1\CommerceReferenceStore\Store\eval\evalbuild.xml
all:
[copy] Copying 1 file to C:\ATG\ATG10.1.1\CommerceReferenceStore\Store\eval
[delete] Deleting: C:\ATG\ATG10.1.1\CommerceReferenceStore\Store\eval\cimOut.
cim.tmp
BUILD SUCCESSFUL
Total time: 0 seconds
Application Server: weblogic
The following installed ATG components are being used to launch:
ATGPlatform version 10.1.1 installed at C:\ATG\ATG10.1.1
Created "C:\ATG\ATG10.1.1\home\CIM\startDynamo.jar" in 15,273ms.
Nucleus running
atg.cim.productconfig.productselector.ProductSelectionContextTask starting...
(Searching for products... done.)
atg.cim.productconfig.productselector.ProductSelectionContextTask finished.
atg.cim.productconfig.appserver.AppServerSelectTask starting...
atg.cim.productconfig.appserver.AppServerSelectTask finished.
atg.cim.productconfig.appserver.AppServerPathTask starting...
atg.cim.productconfig.appserver.AppServerPathTask finished.
atg.cim.productconfig.appserver.DomainPathTask starting...
atg.cim.productconfig.appserver.DomainPathTask finished.
atg.cim.productconfig.appserver.UrlTask starting...
atg.cim.productconfig.appserver.UrlTask finished.
atg.cim.productconfig.appserver.UsernameTask starting...
atg.cim.productconfig.appserver.UsernameTask finished.
atg.cim.productconfig.appserver.PasswordTask starting...
atg.cim.productconfig.appserver.PasswordTask finished.
atg.cim.productconfig.appserver.AppServerSelectionPersistenceTask starting...
atg.cim.productconfig.appserver.AppServerSelectionPersistenceTask finished.
atg.cim.database.CreateSchemaTask starting...
atg.cim.database.CreateSchemaTask finished.
atg.cim.database.ImportDataTask starting...
Combining template tasks...Success
Importing (1 of 1) /CIM/tmp/import/nonswitchingCore-import1.xml:
/CommerceReferenceStore/Store/Storefront/data/pricelists.xml to /atg/commerce/pr
icing/priceLists/PriceLists
/CommerceReferenceStore/Store/Storefront/data/stores.xml to /atg/store/stores/St
oreRepository
/CommerceReferenceStore/Store/Storefront/data/catalog-i18n.xml to /atg/commerce/
catalog/ProductCatalog
/CommerceReferenceStore/Store/Storefront/data/pricelists-i18n.xml to /atg/commer
ce/pricing/priceLists/PriceLists
/CommerceReferenceStore/Store/Storefront/data/sites.xml to /atg/multisite/SiteRe
pository
/CommerceReferenceStore/Store/Storefront/data/sites-i18n.xml to /atg/multisite/S
iteRepository
/CommerceReferenceStore/Store/Storefront/data/promos-i18n.xml to /atg/commerce/c
atalog/ProductCatalog
/CommerceReferenceStore/Store/Storefront/data/seotags-i18n.xml to /atg/seo/SEORe
pository
/CommerceReferenceStore/Store/Storefront/data/wishlists.xml to /atg/commerce/gif
ts/Giftlists
/CommerceReferenceStore/Store/Storefront/data/inventory.xml to /atg/commerce/inv
entory/InventoryRepository
/CommerceReferenceStore/Store/Storefront/data/users.xml to /atg/userprofiling/Pr
ofileAdapterRepository
/CommerceReferenceStore/Store/Storefront/data/orders.xml to /atg/commerce/order/
OrderRepository
/CommerceReferenceStore/Store/Storefront/data/orders-i18n.xml to /atg/commerce/o
rder/OrderRepository
/CommerceReferenceStore/Store/Storefront/data/storetext-i18n.xml to /atg/store/s
tores/StoreRepository
/CommerceReferenceStore/Store/Storefront/data/claimable-i18n.xml to /atg/commerc
e/claimable/ClaimableRepository
... > Success
All Imports Completed Successfully
atg.cim.database.ImportDataTask finished.
atg.cim.worker.common.PropertyFileClearPersistanceTask starting...
atg.cim.worker.common.PropertyFileClearPersistanceTask finished.
atg.cim.productconfig.serverinstance.ServerInstanceNameTask starting...
atg.cim.productconfig.serverinstance.ServerInstanceNameTask finished.
atg.cim.productconfig.serverinstance.PortBindingsSelectTask starting...
atg.cim.productconfig.serverinstance.PortBindingsSelectTask finished.
atg.cim.worker.common.MapPropertyFileCreatorTask starting...
atg.cim.worker.common.MapPropertyFileCreatorTask finished.
atg.cim.worker.common.MapPropertyFileCreatorTask starting...
atg.cim.worker.common.MapPropertyFileCreatorTask finished.
atg.cim.worker.common.MapPropertyFileCreatorTask starting...
atg.cim.worker.common.MapPropertyFileCreatorTask finished.
atg.cim.worker.common.MapPropertyFileCreatorTask starting...
atg.cim.worker.common.MapPropertyFileCreatorTask finished.
atg.cim.worker.common.MapPropertyFileCreatorTask starting...
atg.cim.worker.common.MapPropertyFileCreatorTask finished.
atg.cim.worker.common.MapPropertyFileCreatorTask starting...
atg.cim.worker.common.MapPropertyFileCreatorTask finished.
atg.cim.worker.common.MapPropertyFileCreatorTask starting...
atg.cim.worker.common.MapPropertyFileCreatorTask finished.
atg.cim.worker.common.MapPropertyFileCreatorTask starting...
atg.cim.worker.common.MapPropertyFileCreatorTask finished.
atg.cim.worker.common.MapPropertyFileCreatorTask starting...
atg.cim.worker.common.MapPropertyFileCreatorTask finished.
atg.cim.worker.common.MapPropertyFileCreatorTask starting...
atg.cim.worker.common.MapPropertyFileCreatorTask finished.
atg.cim.worker.common.MapPropertyFileCreatorTask starting...
atg.cim.worker.common.MapPropertyFileCreatorTask finished.
atg.cim.worker.common.MapPropertyFileCreatorTask starting...
atg.cim.worker.common.MapPropertyFileCreatorTask finished.
atg.cim.worker.common.MapPropertyFileCreatorTask starting...
atg.cim.worker.common.MapPropertyFileCreatorTask finished.
atg.cim.worker.common.MapPropertyFileCreatorTask starting...
atg.cim.worker.common.MapPropertyFileCreatorTask finished.
atg.cim.productconfig.serverinstance.MakeServerInstanceFromPatternTask starting.
atg.cim.productconfig.serverinstance.MakeServerInstanceFromPatternTask finished.
atg.cim.productconfig.appassembly.EarFileNameTask starting...
atg.cim.productconfig.appassembly.EarFileNameTask finished.
atg.cim.productconfig.deploy.weblogic.OnlineCreateServerInstanceTask starting...
Error Executing Batch File
atg.cim.worker.TaskException: Error deploying to weblogic
atg.cim.worker.TaskException: Error exececuting batch file
at atg.cim.flow.CimFlowCreator.startHeadlessCimFlow(CimFlowCreator.java:
130)
at atg.cim.Launcher.startCimFlow(Launcher.java:278)
at atg.cim.Launcher.main(Launcher.java:99)
Caused by: atg.cim.worker.TaskException: Error deploying to weblogic
at atg.cim.worker.Task.handleException(Task.java:72)
at atg.cim.productconfig.deploy.weblogic.OnlineCreateServerInstanceTask.
execute(OnlineCreateServerInstanceTask.java:159)
at atg.cim.headless.HeadlessExecutorImpl.executeTasks(HeadlessExecutorIm
pl.java:150)
at atg.cim.headless.HeadlessExecutorImpl.populateAndExecuteHeadlessTasks
(HeadlessExecutorImpl.java:140)
at atg.cim.batch.BatchChooserExecutor.populateAndExecuteHeadlessTasks(Ba
tchChooserExecutor.java:169)
at atg.cim.flow.CimFlow.headlessFlow(CimFlow.java:116)
at atg.cim.flow.CimFlowCreator.startHeadlessCimFlow(CimFlowCreator.java:
120)
... 2 more
Caused by: C:\ATG\ATG10.1.1\CIM\plugins\Base\ant\cim-ant.xml:348: The following
error occurred while executing this line:
C:\ATG\ATG10.1.1\CIM\plugins\Base\ant\cim-ant.xml:254: The following error occur
red while executing this line:
C:\ATG\ATG10.1.1\CIM\plugins\Base\ant\cim-ant.xml:214: exec returned: 1
at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(Projec
tHelper.java:541)
at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.jav
a:394)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor132.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a:105)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
at atg.cim.task.ant.utility.AntExecutionWrapper.executeAntTarget(AntExec
utionWrapper.java:167)
at atg.cim.worker.AntTask.executeAntTarget(AntTask.java:115)
at atg.cim.productconfig.deploy.weblogic.OnlineCreateServerInstanceTask.
execute(OnlineCreateServerInstanceTask.java:155)
... 7 more
Caused by: C:\ATG\ATG10.1.1\CIM\plugins\Base\ant\cim-ant.xml:254: The following
error occurred while executing this line:
C:\ATG\ATG10.1.1\CIM\plugins\Base\ant\cim-ant.xml:214: exec returned: 1
at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(Projec
tHelper.java:541)
at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.jav
a:394)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor132.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a:105)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:62)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor132.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a:105)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.jav
a:391)
... 20 more
Caused by: C:\ATG\ATG10.1.1\CIM\plugins\Base\ant\cim-ant.xml:214: exec returned:
1
at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:636)
at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:662)
at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:487)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor132.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a:105)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:62)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor132.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a:105)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.jav
a:391)
... 34 more
Nucleus shutting down
Nucleus shutdown complete
Thanks.This error is resolved after following the logs in C:\ATG\ATG10.1.1\CIM\log\cim.log. The root cause is I used http as protocol instead of t3 while specifying weblogic admin url.
http://localhost:7001 instead of t3://localhost:7001
Thanks. -
Conversion of Mysql query in oracle acceptable query format
Hi
I have successfully converted my MySql database in oracle. Now the problem is how to execute already written hundreds of Mysql query on the oracle. There are many syntax variation in Mysql query format which is not acceptable for oracle.
For Example
Select case_id as 'this is alias' from cases
The above query can run on Mysql database but have problem while executing Oracle, because single quotes should be replaced with double quotes before executing it on oracle. There are also many other syntax conflicts.
I have tried to resolve the problem through SwisSQLAPI but problem still exist as SwisSQLAPI is not dealing with all syntax conflict. In my case (select if (expresion, true,false)) must be replace with decode (expression, value,true,false) function of oracle and this conversion is not supported by SwisSQLAPI.
Please help me in resolving this problem
ThanksThe problem with trying to port from one language (mysql SQL) to another (oracle SQL) is that there's generally no hard rules for a computer to follow, that it will get it 100% correct.
Look at babelfish when you translate a foreign language to English. The end result is readable (usually), but it's rarely completely correct.
The problem is when you feed something into Oracle SQL, it needs to be 100% correct.
All you can really do here is rewrite these queries. It shouldn't actually take as long as you think, because 50% of queries will generally need very minor changes you can do in a minute, and 25% won't need any changes at all.
Maybe you are looking for
-
Please help me in what all i can do with 8GB variant of iPod touch. And welcome me to Apple family
-
Screen/Desktop Only showing one program at a time...
My mom called me in to look at her iMac earlier today. She said she was moving her illustrator window off to the side when all of the sudden it was "sucked" away to the left side of the screen. Now when she tries to bring up more than one window for
-
Measuring the value of "session_cached_cursors" and "open_cursor"
Friends , Recently In my Database production server Oracle10g (version : 10.2.0.1.0.), I got the "open_cursor" and "session_cached_cursors" related error where OEM asks to increase the value . I have increase the value but the problem still is not so
-
How to include 3rd Party swc files in my Application
Hi , I have downloaded , a calendar component namely "kccalendarflex1.4.0beta-4.1.swc" . I want to include this 3rd party swc file in my Application , please suggest me what are the steps i need to follow to use it in My Application . Thanks
-
Problem with hard reset - can't prompt iTunes restore
So, this is my 3rd time needing to restore my iPhone. I'm about to chuck this thing out the window. I'm stuck on the boot screen and I'm holding the sleep and home buttons so I can prompt the iTunes logo so I can restore it. Well, it's not letting me