OT: Help with MySQL/PHP line (SQL syntax)
I have this now -
$colname_rsPassword = $_POST['password'];
$query_rsPassword = sprintf("SELECT contactFName,
contactLName,
contactPassword, contactEmail, contactRecord FROM
tblcontactdata WHERE
contactPassword = %s", GetSQLValueString($colname_rsPassword,
"text"));
How would I change that to include $_POST['LName'] and
$_POST['FName'] (as
posted from the form) in the WHERE clause?
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com
- Template Triage!
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
==================
I did it another way -
GetSQLValueString($colname_rsPassword, "text"),
$_POST['fname'],
$_POST['lname']);
goes to this -
GetSQLValueString($colname_rsPassword, "text"),
"'".$_POST['fname']."'",
"'".$_POST['lname']."'");
Woiks!
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com
- Template Triage!
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
==================
"Joe Makowiec" <[email protected]> wrote in
message
news:[email protected]..
> On 11 Oct 2006 in macromedia.dreamweaver.appdev, Murray
*ACE* wrote:
>
>> SELECT contactFName, contactLName, contactPassword,
contactEmail,
>> contactRecord FROM tblcontactdata WHERE
contactPassword =
>> 'uwUYreTTM' AND contactFName = Murray AND
contactLName = Summers
>
> That might be the problem. Try adding the quotes to the
string:
>
> $query_rsPassword = sprintf("SELECT contactFName,
contactLName,
> contactPassword, contactEmail, contactRecord FROM
tblcontactdata WHERE
> contactPassword = %s AND contactFName = '%s' AND
contactLName = '%s'",
> GetSQLValueString($colname_rsPassword, "text"),
$_POST['fname'],
> $_POST['lname']);
>
> --
> Joe Makowiec
>
http://makowiec.net/
> Email:
http://makowiec.net/email.php
Similar Messages
-
Help with Flex - PHP - and SQL Server
Good afternoon,
I have been working on this problem for over a week and am at
my wit's end. I am trying to create an application that will allow
me and my fellow statisticians to share code easily. The
technologies at my disposal are Flex, PHP and SQL Server 2005. The
web server is IIS. I have downloaded and installed the PHP driver
for SQL Server 2005 and am able to query the database and generate
XML. The problem I'm having is that I can't return the XML from PHP
to Flex.
If I execute the php code in a web browser and view the
source, it looks like XML. I can then cut and paste the exact same
code into an xml file and read it in from the harddisk and the tree
will populate. Can anyone please help me? I don't have flex builder
so I it's hard for me to use trace and view what is going on.
Thanks in advance,
Eric GravesThanks for the suggestion. I have tried every permutation of
e4x path notation I can think of. You're right, you're not supposed
to need the root level as that's supposed to be returned in the
result. So you should only need to reference first level after the
root. When I do this and launch the .SWF I get a completely empty
tree.
I think the problem lies somewhere in my understanding of
what format Flex needs returned from a HTTPRequest. It's my
understanding that it just needs to be XML. As far as I can tell,
that's what I'm sending it. On the PHP side, does it have to be
cast a special way? Everything I've seen just shows people using
ECHO to output the XML data. -
Help with MySQL/PHP Connection
Hi,
I'm making a site that requires the storage of information via MySQL. I've set up my testing server, and it connects fine. When I try to add a MySQL connection, however, I keep getting the "HTTP Error Code 404: File Not Found" error. I've tried using both the MySQL server provided by my web host and one hosted on my own computer (using "localhost" as the server), but both give me the same error. The error box says that perhaps:
1) There is no testing server running on the server machine.
2) The testing server specified for this site does not map to the http://**mywebsite**.com/_mmServerScripts/MMHTTPDB.php URL. Verify that the URL Prefix maps to the root of the site.
I'm certain it's not #1, because both of my MySQL servers work fine outside of Dreamweaver. But I'm not quite sure what #2 is saying. Any help?
Thanks in advance.nickf77 wrote:
I have my testing server set up at my FTP account that came with my hosting package. Should it not be?
It's not ideal, but you can do it that way. The principle is still the same.
When using a remote connection, the value of Host directory is the same as you use for FTP connections to your remote site. In many cases, this is left blank, is simply a forward slash, or is something like public_html. In any event, it's the root level of your website.
URL prefix is also the root level of your site, but expressed as a URL: http://www.example.com/.
Host directory and URL prefix must both point to the same place. The first is a path, the second is a web address. -
i need help with this 1 line if some one passed the argument 'A' it would only print out the characters from 0-4 how can this be coded?????????
public class A {
public static void main(String[] args) {
String[] characters = new String[ 130 ];
characters[ 0 ] = new String(" * "); // A
characters[ 1 ] = new String("* *");
characters[ 2 ] = new String("*****");
characters[ 3 ] = new String("* *");
characters[ 4 ] = new String("* *");
characters[ 5 ] = new String("**** "); // B
characters[ 6 ] = new String("* *");
characters[ 7 ] = new String("**** ");
characters[ 8 ] = new String("* *");
characters[ 9 ] = new String("**** ");
for (int nCharacter = 0; nCharacter < args[ 0 ].length(); nCharacter++) {
char aChar = args[ 0 ].charAt (nCharacter);
[\code]Not a very efficient method - but it will work;-public class junk{
public static void main(String[] args) {
String letter = "A";//args[0].toUpperCase();
char c = letter.charAt(0);
int start= getStart(c);
int end = getLast(c);
String[] characters = new String[ 130 ];
characters[ 0 ] = new String(" * "); // A
characters[ 1 ] = new String("* *");
characters[ 2 ] = new String("*****");
characters[ 3 ] = new String("* *");
characters[ 4 ] = new String("* *");
characters[ 5 ] = new String("**** "); // B
characters[ 6 ] = new String("* *");
characters[ 7 ] = new String("**** ");
characters[ 8 ] = new String("* *");
characters[ 9 ] = new String("**** ");
for(int i=start; i<end; i++) System.out.println(characters);
/*for (int nCharacter = 0; nCharacter < args[ 0 ].length(); nCharacter++) {
char aChar = args[ 0 ].charAt (nCharacter); */
private static int getStart(char c){
int temp = 0;
switch(c){
case 'A' : temp = 0; break;
case 'B' : temp = 5; break;
return temp;
private static int getLast(char c){
int temp = 0;
switch(c){
case 'A' : temp = 5; break;
case 'B' : temp = 10; break;
return temp; -
I need help with DW, PHP & MySQL please.
Hello, I am new to website development and am trying to set up a form for collecting data on my website and have a question that I can’t find an answer to anywhere else. I was wandering if someone there would be kind enough to help? I am using Dreamweaver in CS4 and my host already has PHP & MySQL installed on the server that I can use. My question is: Do I need to download XAMP or WAMP on my computer before trying to connect my form to the server? Also, do I need to change the page I am putting the form on to .PHP extension or can I just embed the PHP form into an existing HTML page?
Most of the training tutorials I’ve read don’t start at the most basic beginning but rather expect people to already have a basic knowledge of the topics they are trying to learn. If anyone knows the best place to get answers to the most basic questions like this one or a beginners guide to working with DW, PHP & MySQL I will gladly go there rather than waste your time on questions you’ve probably already answered a bezillion times.
Thank you for the help.Strictly speaking, you don't need XAMPP or WAMP on your local computer. But if you're serious about getting involved with PHP/MySQL, you should definitely set up a local testing environment with one or the other. It's safer and more efficient. Don't expose all your errors on a live server. You can find instructions on how to set up a testing environment here: http://www.adobe.com/devnet/dreamweaver/articles/setting_up_php.html.
To develop with PHP, you should always use a .php file name extension. Any other choice is very rare.
There's a tutorial on building your first dynamic website with DW here: http://www.adobe.com/devnet/dreamweaver/articles/first_dynamic_site_pt1.html.
For more in-depth help, you might want to consider grabbing hold of a copy of "The Essential Guide to Dreamweaver CS4 with CSS, Ajax, and PHP". (Yes, I wrote it, so it's a bit of shameless self-promotion, but you'll find it answers many of your questions - and probably a lot you hadn't even thought of.) -
SQL Developer 1.1.0.21: Issues with Data Grid and SQL syntax checking
In this new release of SQL Dev, when I execute a SQL in the SQL Worksheet and click in the Data Grid in the Results tab and try to navigate within a record using arrow keys, the grid cell enters into edit mode by default and so I cannot use the Left or Right arrow keys to navigate the grid. I am forced to use tab key to navigate. This is counter intuitive in my opinion.
Is there any option to change this behavior?
Another issue that I have come across is with SQL syntax checking. In some cases, when I press F9 to execute a SQL, it shows the SQL as executed i.e. shows something like 0.0134 seconds in the toolbar and no results displayed. In reality, the SQL had some syntax error which were NOT reported. This can be frustrating since now I have to fall back to SQL*Plus or TOAD just for syntax check.
I like the fact that SQLDev highlights the current SQL but it would be more useful if it just indicated the first line of the current sql instead of highlighting the whole sql.
Manish"In this new release of SQL Dev, when I execute a SQL in the SQL Worksheet and click in the Data Grid in the Results tab and try to navigate within a record using arrow keys, the grid cell enters into edit mode by default and so I cannot use the Left or Right arrow keys to navigate the grid. I am forced to use tab key to navigate. This is counter intuitive in my opinion."
In the "Results" tab, Click Ctrl & Tab keys (at the same time) or with mouse click on any cell other than the first column (a sequence or rownum), you will be able to navigate using the arrow keys.
"Another issue that I have come across is with SQL syntax checking. In some cases, when I press F9 to execute a SQL, it shows the SQL as executed i.e. shows something like 0.0134 seconds in the toolbar and no results displayed. In reality, the SQL had some syntax error which were NOT reported. This can be frustrating since now I have to fall back to SQL*Plus or TOAD just for syntax check."
The 0.0134 seconds could be the result of the most recently executed successful statement. Check the Script Output tab for errors. Use F5 (Run Script option) instead of F9.
"I like the fact that SQLDev highlights the current SQL but it would be more useful if it just indicated the first line of the current sql instead of highlighting the whole sql."
On the SQL statement (or code), Right Click -> Format SQL (or press Ctrl & B), proper formatting would help.
I use version 1.0.0.15.57 and seems to be working allright.
- Babu Rangasamy -
Help with mySQL Connection string
Here is hoping someone can help & once I get it down I promise I'll post all my work on this list so some other newbie can benefit.
I'm simply trying to run a very very straightforward JDBC test with mySQL & I keep getting the "Server configuration denies access to data source" error. But before you tell me that I must simply look at what my mysql.db & mysql.user table allows - I'VE TRIED THAT. I realize that the error is probably there somewhere - but I can't see it.
I've tried connecting with 2 different accounts - the provided "root" & a user I created "deep" to 2 different databases the provided "test" & "testdb" which I created) . Here is what mysql says about the two different databases
mysql> select * from db;
Host | Db | User |.......
-----+------------+-------
| % | test | | ......
| % | test\_% | | ........
| localhost | testdb | deep |........Note that "root" should have access to "test" & deep@localhost should have access to "testdb" right?
So here are all the connection strings I have tried - all return the same error below
Connection conn = DriverManager.getConnection(
"jdbc:mysql://localhost:3306/test", "root", "mypass"
// "jdbc:mysql://localhost:3306/testdb", "deep", "mypass"
// "jdbc:mysql://localhost/testdb?user=deep&password=mypass"
// "jdbc:mysql://localhost/testdb", "deep", "mypass"
// "jdbc:mysql://localhost:3306/testdb?user=deep@localhost&password=mypass"
// "jdbc:mysql://localhost:3306/testdb?user=deep&password=mypass"
// "jdbc:mysql://localhost/testdb", "deep@localhost", "mypass"
// "jdbc:mysql:///test", "root", "mypass"
// "jdbc:mysql://localhost/test", "root@localhost", "mypass"
);My Error:
Exception in thread "main" java.sql.SQLException: Server configuration denies access to data source
at org.gjt.mm.mysql.MysqlIO.init(MysqlIO.java:193)
at org.gjt.mm.mysql.Connection.connectionInit(Connection.java:261)
at org.gjt.mm.mysql.jdbc2.Connection.connectionInit(Connection.java:89)
at org.gjt.mm.mysql.Driver.connect(Driver.java:167)
at java.sql.DriverManager.getConnection(DriverManager.java:517)
at java.sql.DriverManager.getConnection(DriverManager.java:199)
at TestMySQL4.main(TestMySQL4.java:76)BTW:
I am using MacOSX 10.1
MySQL 3.23.42
The driver is: mm.mysql-2.0.6.jar
Please help!
'deephi amandeep
well i m getting the same error message when trying to connect MYSQL using mm.jdbc driver.
java.sql.SQLException : Server configuration denies access to data base source.
query.jdbcDriver org.gjt.mm.mysql.Driver
query.databaseURL jdbc:mysql://aaa.bbb.com/pluto
query.databaseUserName samin
query.databasePwd samin
query.summaries true
i hve installed mysql on server aaa.bbb.com network 1
and trying to run application on network 2
Thanks
samir -
Help with html / php contact form
Hi guys I was hoping to get some help with a contact form on my website, to be honest I havent a clue about php but kind of okay with html thats why the php code is just a copy and paste from some website, just trying to marry it up with the html but getting errors.
Hopfully one of you can see the problem.
Error on Submitting:
Notice: Undefined variable: name in \\nas44ent\Domains\g\gethinhayman.co.uk\user\htdocs\send_form_email.php on line 69
Notice: Undefined variable: message in \\nas44ent\Domains\g\gethinhayman.co.uk\user\htdocs\send_form_email.php on line 75
We are very sorry, but there were error(s) found with the form you submitted. These errors appear below.
The Name you entered does not appear to be valid.
The Comments you entered do not appear to be valid.
HTML Code:
<section id="contact" class="four">
<div class="container">
<header>
<h2>Contact</h2>
</header>
<form method="post" action="send_form_email.php">
<div class="row half">
<div class="6u"><input type="text" class="text" name="name" placeholder="Name" /></div>
<div class="6u"><input type="text" class="text" name="email" placeholder="Email" /></div>
</div>
<div class="row half">
<div class="12u">
<textarea name="message" placeholder="Message"></textarea>
</div>
</div>
<div class="row">
<div class="12u">
<a href="http://www.mywebsite.co.uk/email_form.php" class="button submit">Send Message</a>
</div>
</div>
</form>
</div>
</section>
php Code:
<?php
if(isset($_POST['email'])) {
$email_to = "my email address";
$email_subject = "Mail from Site";
function died($error) {
// your error code can go here
echo "We are very sorry, but there were error(s) found with the form you submitted. ";
echo "These errors appear below.<br /><br />";
echo $error."<br /><br />";
echo "Please go back and fix these errors.<br /><br />";
die();
// validation expected data exists
if(!isset($_POST['name']) ||
!isset($_POST['email']) ||
!isset($_POST['message'])) {
died('We are sorry, but there appears to be a problem with the form you submitted.');
$first_name = $_POST['name']; // required
$email_from = $_POST['email']; // required
$comments = $_POST['message']; // required
$error_message = "";
$email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
if(!preg_match($email_exp,$email_from)) {
$error_message .= 'The Email Address you entered does not appear to be valid.<br />';
$string_exp = "/^[A-Za-z .'-]+$/";
if(!preg_match($string_exp,$name)) {
$error_message .= 'The Name you entered does not appear to be valid.<br />';
if(strlen($message) < 1) {
$error_message .= 'The Comments you entered do not appear to be valid.<br />';
if(strlen($error_message) > 0) {
died($error_message);
$email_message = "Form details below.\n\n";
function clean_string($string) {
$bad = array("content-type","bcc:","to:","cc:","href");
return str_replace($bad,"",$string);
$email_message .= "Name: ".clean_string($name)."\n";;
$email_message .= "Email: ".clean_string($email)."\n";
$email_message .= "Message: ".clean_string($message)."\n";
// create email headers
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers);
?>
<?php
?>PHP CODE: SaveAs send_form_email.php
<?php
if(isset($_POST['email'])) {
// EDIT THE 2 LINES BELOW AS REQUIRED
$email_to = "[email protected]";
$email_subject = "Your email subject line";
function died($error) {
// your error code can go here
echo "We are very sorry, but there were error(s) found with the form you submitted. ";
echo "These errors appear below.<br /><br />";
echo $error."<br /><br />";
echo "Please go back and fix these errors.<br /><br />";
die();
// validation expected data exists
if(!isset($_POST['name']) ||
!isset($_POST['email']) ||
!isset($_POST['message'])) {
died('We are sorry, but there appears to be a problem with the form you submitted.');
$name = $_POST['name']; // required
$email_from = $_POST['email']; // required
$comments = $_POST['message']; // required
$error_message = "";
$email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
if(!preg_match($email_exp,$email_from)) {
$error_message .= 'The Email Address you entered does not appear to be valid.<br />';
$string_exp = "/^[A-Za-z .'-]+$/";
if(!preg_match($string_exp,$name)) {
$error_message .= 'The Name you entered does not appear to be valid.<br />';
if(strlen($message) < 2) {
$error_message .= 'The message you entered does not appear to be valid.<br />';
if(strlen($error_message) > 0) {
died($error_message);
$email_message = "Form details below.\n\n";
function clean_string($string) {
$bad = array("content-type","bcc:","to:","cc:","href");
return str_replace($bad,"",$string);
$email_message .= "Name: ".clean_string($name)."\n";
$email_message .= "Email: ".clean_string($email_from)."\n";
$email_message .= "Message: ".clean_string($message)."\n";
// create email headers
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers);
?>
<!-- include your own success html here -->
Thank you for contacting us. We will be in touch with you very soon.
<?php
?>
HTML Code -- save as html page.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Contact Form</title>
</head>
<body>
<section id="contact" class="four">
<div class="container">
<header>
<h2>Contact</h2>
</header>
<form method="post" action="send_form_email.php">
<div class="row half"> <div class="6u">
<input type="text" class="text" name="name" placeholder="Name" />
</div>
<div class="6u">
<input type="text" class="text" name="email" placeholder="Email" />
</div>
</div>
<div class="row half"> <div class="12u">
<textarea name="message" placeholder="Message"></textarea>
</div>
</div>
<div class="row">
<div class="12u">
<input type="submit" name="submit" value="Send">
</div>
</div>
</form>
</div>
</section>
</body>
</html>
Upload both to your Apache server to test.
EDIT: changed typo on Submit button -- valuse to value.
Nancy O. -
Help with "ORA-06511: PL/SQL: cursor already open"
I've tried numerous variations on this piece of code and I always get the same result. I'm sure this is painfully obvious to an experienced PL/SQL person.
Any help will be appreciated!
Thank You!
1 DECLARE
2 CURSOR EMP_CURSOR IS SELECT last_name from employees;
3 current_last_name varchar2(25);
4 BEGIN
5 IF EMP_CURSOR%ISOPEN
6 THEN
7 dbms_output.put_line ('cursor is already open');
8 close EMP_CURSOR;
9 END IF;
10 dbms_output.put_line ('opening cursor');
11 OPEN EMP_CURSOR;
12 FOR item in EMP_CURSOR LOOP
13 FETCH EMP_CURSOR INTO current_last_name;
14 EXIT WHEN EMP_CURSOR%NOTFOUND;
15 dbms_output.put_line (item.last_name);
16 END LOOP;
17 CLOSE EMP_CURSOR;
18* END;
19 /
DECLARE
ERROR at line 1:
ORA-06511: PL/SQL: cursor already open
ORA-06512: at line 2
ORA-06512: at line 12Mathieu,
Log in as anotherSchema and grant select on 'IDsTable' to the current user.
SQL> r
1 create or replace function f1(theID varchar2) return mytype pipelined is
2 out varchar2(30);
3 cursor myCursor (x varchar2) is select * from scott.emp where job=x;
4 begin
5 for rec in myCursor(theID) loop
6 pipe row(rec.ename);
7 end loop;
8 return;
9* end;
Warning: Function created with compilation errors.
SQL> show errors
Errors for FUNCTION F1:
LINE/COL ERROR
3/33 PL/SQL: SQL Statement ignored
3/53 PL/SQL: ORA-00942: table or view does not exist
6/1 PL/SQL: Statement ignored
6/10 PLS-00364: loop index variable 'REC' use is invalid
SQL> connect scott
Enter password: *****
Connected.
SQL> grant select on emp to testuser;
Grant succeeded.
SQL> connect testuser
Enter password: ****
Connected.
SQL> create or replace function f1(theID varchar2) return mytype pipelined is
2 out varchar2(30);
3 cursor myCursor (x varchar2) is select * from scott.emp where job=x;
4 begin
5 for rec in myCursor(theID) loop
6 pipe row(rec.ename);
7 end loop;
8 return;
9 end;
10 /
Function created.
SQL> disconnect
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.3.0 - 64bit Production
With the Partitioning option
JServer Release 9.2.0.3.0 - Production
SQL> -
Need help with simple php files
I have simple php files that are setup with includes for a header, sidebar and footer... all other data is within the file. There is no dynamic info on the pages, yet I cannot get the files to load up in InContext. Is there a way to make this work?
I can get an html file to work flawless, but something seems to stop the php file from working.
Thanks,
Ken HendersonWhat I mean is, whenever I try to edit any file with a php extension, I get a 404 error... even a simple file with no includes. I created a php file with one line of text within an editable region and I still could not edit it with InContext.
The site I'm trying to work with is http://www.thunderbirdchemical.com
The homepage is index.php
The simple test file I made is test.php
Thanks for your help.
Ken -
Help with mysql query plz anyone i am begging!!!
Hi everyone pls forgive me i am new to java. can someone pls tel me where i am going wrong wit this mysql query?
<sql:query var="parish" maxRows="1" dataSource="jdbc/gav">
SELECT ParishName, OwnerOccupierHousehold, OwnerOccupierPercOfOverall, OwnerOccupierCo2Emissions,
SocialRentedHousehold, SocialRentedPercOfOverall, SocialRentedCo2Emissions, PrivateRentedHousehold,
PrivateRentedPercOfOverall, PrivateRentedCo2Emission, TotalHouseholds, TotalPerc, Average,
Total2001, TotalEstimatedTotal2006, EmissionsPerPerson, EmissionPerHousehold, EmissionsPerParish,
EnergyChampionsNeeded, NumberOfPeopleAtWork, NumberOfSchoolAgeChildren
FROM base_data as b
WHERE b.id = ? <sql:param value="${param.id}"/>
<sql:param value="${param.id}"/>
</sql:query>
<c:set var="parish" scope="request" value="${parish.rows[0]}"/>
here is the error i get:
java.sql.SQLException: Parameter index out of range (2 > number of parameters, which is 1).
please any help would be appreciated!!! Thanks in advance guys .here is my code for the form on the index page:
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
<sql:query var="parish" dataSource="jdbc/gav">
SELECT id, ParishName FROM base_data
</sql:query>
<form action="response.jsp">
Select a Parish: <select name="id">
<c:forEach var="parish" items="${parish.rows}">
<option value="${parish.id}">${parish.ParishName}</option>
</c:forEach>
</select><br><input type="submit" value="submit" name="submit" /></form>
here is the code for the response page:
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
<sql:query var="parish" maxRows="1" dataSource="jdbc/gav">
SELECT b.id, b.ParishName, b.OwnerOccupierHousehold, b.OwnerOccupierPercOfOverall, b.OwnerOccupierCo2Emissions,
b.SocialRentedHousehold, b.SocialRentedPercOfOverall, b.SocialRentedCo2Emissions, b.PrivateRentedHousehold,
b.PrivateRentedPercOfOverall, b.PrivateRentedCo2Emission, b.TotalHouseholds, b.TotalPerc, b.Average,
b.Total2001, b.TotalEstimatedTotal2006, b.EmissionsPerPerson, b.EmissionPerHousehold, b.EmissionsPerParish,
b.EnergyChampionsNeeded, b.NumberOfPeopleAtWork, b.NumberOfSchoolAgeChildren
FROM base_data as b
WHERE b.id = ? <sql:param value="${param.id}"/>
</sql:query>
<c:set var="parish" scope="request" value="${parish.rows[0]}"/>
i display the results like this : ${parish.EmissionsPerParish}
the user should be able to select a parish from a form and then sql query created and then i want to show the row results on the response page.
could you tell me where so should be a simple process although not simple enough as it may seem.
thanks for the advice keith -
Need help with MySQL connection error _mmServerScripts
Trying to create insert a recordset I got the message:
"The files from the _mmServerScripts folder are for the server model PHP-MySQL. You try to connect to a database using a different server model .Please remove this folder outside the Dreamweaver environment on both local and testing machines and try again."
I've searched the net and have seen this message hunting people since dw8...
I could not find a "cure".
Things to notice:
0 - Yes the whole thing is apache/php/mysql... just DW thinks it's not.
1 - Both the connection and the Recordset actualy works. I have a whole site based on this connection and the recorsets I've created manualy based on it.
2 - It does not matter if we erase or not the _mmServerScripts folder the message stands still allover.
3 - The problem seems to show up when you split servers...
3.1 - If I test in a WAMP environment where apache and mysql are in the same machine I can use DW to create data objects for me.
3.2 - If I test in my real test environment which have web server and db server separated from each other then I can't use DW to create data objects, see bindings, behaviours etc... all I get is this message.... while the code itself runs fine anyway.
Does any one already knows how to work around or fix this?
Thanks,
JulioThanks PZ,
Yes everything is fine with the site definition.
everything works. I can upload, run, test all ok.
The only thing that does not work is to insert any sort of data object through DW interface. If I declare my reordsets by hands or even If I use the ones DW created in my local test server all works fine.
Then if I use the site definition and try to see any bindings or create a recordset or create a new connection using dw... then the messages come up and dw can't go any further in that task.
By spli servers I mean one phisical linux server with apache/php but without mySQL + one physical Linux server with mySQL but without apache/php.
So when I use a site definition that points either to a WAMP or LAMP i.e. when everything is in the same machine DW goes happy and does whatever it's asked to do.
When I try that on the real mccoy environment (with the two separated servers)... It looks like DW gets confused... -
On
www.imagesandwords.org.uk/andrewjamesrp/
I had a go with a PHP CSS switcher using a tutorial from,
www.alistapart.com/articles/phpswitch/
and I can't seem to get it working.
I want to do some more complex changes in the css but for now am just trying to work out the php. Can anyone help me? I am not sure what information to inclue but I have done my damndest to follow the tutorial.
You can see that the page isn't in the root directory but the php and css files are in the andrewjamesrp folder.
Thanks
MartinThanks Nate
Here's the link: http://imagesandwords.org.uk/andrewjamesrp/index.html
Here's switcher.php
< ?php
$set = $_GET['set'];
setcookie ('sitestyle', $set, time()+31536000, '/', 'www.imagesandwords.org.uk', '0');
header("Location: $HTTP_REFERER");
?>
Here's my < head>:
< link href="stylemain.css" rel="stylesheet" type="text/css" media="all"/>
< link rel="stylesheet" type="text/css" media="screen" title="User Defined Style" href="<?php echo (!$sitestyle)?'stylemain':$sitestyle ?>.css" />
< link rel="alternate stylesheet" type="text/css" media="screen" title="Red" href="red.css" />
< link rel="alternate stylesheet" type="text/css" media="screen" title="Blue" href="blue.css" />
< link rel="alternate stylesheet" type="text/css" media="screen" title="Green" href="green.css" />
< /head>
And here's the switch in the < body>
< li id="red">< a href="./switcher.php?set=styleone">1</a></li>
< li id="green">< a href="/switcher.php?set=styletwo">2</a></li>
< li id="blue">< a href="switcher.php?set=stylethree">3</a></li>
I have used different ways of referencing the switcher.php there because I am not sure how to do it. This page is a practice in my own site so the index.html is not in the true root.
I have changed the file extension to .html and I think my host uses PHP 4.2.something. Or not PHP 5.
Regards
Martin -
Help with long term lines down
no landline or Broadband since the beginning of December major fault with a number of lines Promised repair before but didn't happen, now promised for 22 December no help from BT there should be an automatic ability to credit mobiles when a problem is long term as it is occurring.
BT will give you a free divert of your landline number to your mobile until the fault is fixed.
There are some useful help pages here, for BT Broadband customers only, on my personal website.
BT Broadband customers - help with broadband, WiFi, networking, e-mail and phones. -
Help with MYSQLi Query and WHILE statement
Hi,
Not sure what is wrong here but the same record is printed in the while loop 11 times (the amount of records in the table).
<?php
//Main Connection & Query
//Database Connection & Error
$con_host = 'X';
$con_username = 'X';
$con_password = 'X';
$con_database = 'X';
$con = mysqli_connect($con_host, $con_username, $con_password, $con_database);
?>
<?php
//Query
$sql = "SELECT * FROM equipment ORDER BY name ASC";
$query = mysqli_query($con, $sql);
$row = mysqli_fetch_assoc($query);
$row_count = mysqli_num_rows($query);
//Create Variables
$name = $row['name'];
$size = $row['size'];
$quantity = $row['quantity'];
$protection = $row['protection'];
$location = $row['location'];
$sublocation = $row['sublocation'];
$bc = $row['BC'];
$id = $row['id'];
?>
<!doctype html>
<html>
<link href="stylesheets/main_stylesheet.css" rel="stylesheet" type="text/css">
<link href='http://fonts.googleapis.com/css?family=Slabo+27px' rel='stylesheet' type='text/css'>
<!-- Favicon -->
<link rel="shortcut icon" type="image/png" href="images/icon.png" />
<style type="text/css">
</style>
<head>
<meta charset="utf-8">
<title>Print Equipment List</title>
<link href="stylesheets/print_stylesheet.css" rel="stylesheet" type="text/css">
<script src="sorttable.js"></script>
<!--<body onload="window.print()">-->
</head>
<body>
<div class="print_button no-print" onClick="window.print()">Print</div>
<div class="print_text no-print">Select the sorting of the list by clicking on the table categories and click the print button below</div>
<div class="print_a4page">
<div class="print_header">
<div class="print_header_logo"><img src="images/logo.png" width="306" height="43"></div>
<div class="print_header_text" id="header_text">Drama Database</div>
<div class="print_header_info">List printed: <script type="text/javascript">
var currentTime = new Date();
var month = currentTime.getMonth() + 1;
var day = currentTime.getDate();
var year = currentTime.getFullYear();
document.write(day + "/" + month + "/" + year);</script>
<br>
Total records:
<?php echo $row_count ?></div>
</div>
<div class="print_header_divider">Equipment List</div>
<div class="print_body">
<div>
<form name="users" method="post">
<div class="table_print">
<table width="100%" border="0" cellpadding="5" class="sortable">
<tr class="table_header_print">
<th width="15%" scope="col">Name</th>
<th width="12%" scope="col">Size</th>
<th width="9%" scope="col">Quantity</th>
<th width="12%" scope="col">Protection</th>
<th width="17%" scope="col">Location</th>
<th width="12%" scope="col">Sublocation</th>
<th width="11%" scope="col">Barcode</th>
<th width="12%" scope="col">Internal ID</th>
</tr>
<?php do { ?>
<tr class="table_body">
<td><?php echo $name ?></td>
<td><?php echo $size ?></td>
<td><?php echo $quantity ?></td>
<td><?php echo $protection ?></td>
<td><?php echo $location ?></td>
<td><?php echo $sublocation ?></td>
<td><?php echo $bc ?></td>
<td><?php echo $id ?></td>
</tr>
<?php } while ($row = mysqli_fetch_assoc($query));?>
</table>
</form>
</div>
</div>
</div>
</body>
</html>Still getting the same issue.
As I see it, the way you have suggested is just rearanging things right?
here is a screenshot of the outcome:
And here is the improved code:
<?php
//Main Connection & Query
//Database Connection & Error
$con_host = 'X';
$con_username = 'X';
$con_password = 'X';
$con_database = 'X';
$con = new mysqli($con_host, $con_username, $con_password, $con_database);
?>
<?php
//Query
$sql = "SELECT * FROM equipment ORDER BY name ASC";
$result = $con->query($sql);
$row = $result->fetch_assoc();
$row_count = $result->num_rows;
//Create Variables
$name = $row['name'];
$size = $row['size'];
$quantity = $row['quantity'];
$protection = $row['protection'];
$location = $row['location'];
$sublocation = $row['sublocation'];
$bc = $row['BC'];
$id = $row['id'];
?>
<!doctype html>
<html>
<link href="stylesheets/main_stylesheet.css" rel="stylesheet" type="text/css">
<link href='http://fonts.googleapis.com/css?family=Slabo+27px' rel='stylesheet' type='text/css'>
<!-- Favicon -->
<link rel="shortcut icon" type="image/png" href="images/icon.png" />
<style type="text/css">
</style>
<head>
<meta charset="utf-8">
<title>Print Equipment List</title>
<link href="stylesheets/print_stylesheet.css" rel="stylesheet" type="text/css">
<script src="sorttable.js"></script>
<!--<body onload="window.print()">-->
</head>
<body>
<div class="print_button no-print" onClick="window.print()">Print</div>
<div class="print_text no-print">Select the sorting of the list by clicking on the table categories and click the print button below</div>
<div class="print_a4page">
<div class="print_header">
<div class="print_header_logo"><img src="images/logo.png" width="306" height="43"></div>
<div class="print_header_text" id="header_text">Drama Database</div>
<div class="print_header_info">List printed: <script type="text/javascript">
var currentTime = new Date();
var month = currentTime.getMonth() + 1;
var day = currentTime.getDate();
var year = currentTime.getFullYear();
document.write(day + "/" + month + "/" + year);</script>
<br>
Total records:
<?php echo $row_count ?></div>
</div>
<div class="print_header_divider">Equipment List</div>
<div class="print_body">
<div>
<form name="users" method="post">
<div class="table_print">
<table width="100%" border="0" cellpadding="5" class="sortable">
<tr class="table_header_print">
<th width="15%" scope="col">Name</th>
<th width="12%" scope="col">Size</th>
<th width="9%" scope="col">Quantity</th>
<th width="12%" scope="col">Protection</th>
<th width="17%" scope="col">Location</th>
<th width="12%" scope="col">Sublocation</th>
<th width="11%" scope="col">Barcode</th>
<th width="12%" scope="col">Internal ID</th>
</tr>
<?php while ($row = $result->fetch_assoc()) { ?>
<tr class="table_body">
<td><?php echo $name ?></td>
<td><?php echo $size ?></td>
<td><?php echo $quantity ?></td>
<td><?php echo $protection ?></td>
<td><?php echo $location ?></td>
<td><?php echo $sublocation ?></td>
<td><?php echo $bc ?></td>
<td><?php echo $id ?></td>
</tr>
<?php } ?>
</table>
</form>
</div>
</div>
</div>
</body>
</html>
Maybe you are looking for
-
Verizon gives the runaround – Doesn't honor agreed upon price.
I would like to tell everyone about three problems I am having with FiOS. Problem 1: Just after Christmas I tried to order FiOS service online, but I had issues with the website (Verizon connections page – I get a discount through my employer). So af
-
How do I get the Data useage Icon/widget back on my Stratosphere?
Some how I deleted this Icon/widget that showed my Verizon data useage and I can't figure out how to get it back. I'm sure it's simple, but I can't find it. Thanks
-
3 problems! Please help!
Hi, I am looking for some major help & hopefully someone here can come to my aid! *1st problem:* On my website i wished to have a 'twitter' feed, having it obviously display information from a twitter account. As i tried to edit it, changing font, co
-
PSE 9 Organizer Slide show can't find the slide show project files after moving from XP to Windows 7
A bad computer virus forced us to move all our files and programs from XP to Windows 7. The PSE Editor seems to be working properly, but the Organizer Slide Show can't find the project files. The structure of each of the 15 slide shows (blank slide
-
Architecture question...where to put the code
Newbie here, so please be gentle and explicit (no detail is too much to give or insulting to me). I'm hoping one of you architecture/design gurus can help me with this. I am trying to use good principals of design and not have code scattered all over