jayhawker
-
Posts
11 -
Joined
-
Last visited
Never
Posts posted by jayhawker
-
-
Thanks again for trying to help. Unfortunately, I have issues that I haven't been able to resolve. No errors, I just don't get any data.
Using the code above, the numbers represent an actual order number, there is data in the fields, but for some reason I don't get anything back when I trying to use it in a function on the page. I have the exact same code in another part of part of the page tha tis not in a function and it works fine, pulling the data from the tables and displaying it in an echo.
The function that I am trying to accomplish the same thing in is to e-mail the same information that echoe's successfully. I am about to pull my hair out trying to figure out why I can't get any data.
Any ideas?
-
Thanks! That was very hefpful. Yes, I am using DreamWeaver but only because this particular web app was created 5 years ago in it and has several add-ins.
What editor do you recommend. I am usually developing with .net using Visual Studio.
Also, if I were to write the following code:
$orderID = '45495562754892521062894091';
mysql_select_db($database_mx_shop, $t_shop);
$query_rsOrderDetails = sprintf("SELECT * FROM orderdetail_ode WHERE idord_ode = $orderID");
$rsOrderDetails = mysql_query($query_rsOrderDetails, $t_shop);
$row_rsOrderDetails = mysql_fetch_assoc($rsOrderDetails);
If I have a field named "firstname" in the database "orderdetail" , would I not use the following code to get the value that is in "firstname" for the record with the the primarkey 45495562754892521062894091 ?
$firstname = $row_rsOrderDetails['firstname'];
Thanks again for the assistance.
-
In the following code: what do the following basicall do?
1.) $colname_rsOrderDetails = "-1";
2.) $colname_rsOrderDetails = (get_magic_quotes_gpc()) ? $_SESSION['id_ord'] : addslashes($_SESSION['id_ord']);
3.) $query_rsOrderDetails = sprintf("SELECT * FROM orderdetail_ode WHERE idord_ode = %s", GetSQLValueString($colname_rsOrderDetails, "text"));
And also what does the %s stand for
4.) %s
$colname_rsOrderDetails = "-1";
$_SESSION['id_ord'] = "{id_ord}";
if (isset($_SESSION['id_ord'])) {
$colname_rsOrderDetails = (get_magic_quotes_gpc()) ? $_SESSION['id_ord'] : addslashes($_SESSION['id_ord']);
}
mysql_select_db($database_t_shop, $t_shop);
$query_rsOrderDetails = sprintf("SELECT * FROM orderdetail_ode WHERE idord_ode = %s", GetSQLValueString($colname_rsOrderDetails, "text"));
$rsOrderDetails = mysql_query($query_rsOrderDetails, $mx_shop); or die(mysql_error());
$row_rsOrderDetails = mysql_fetch_assoc($rsOrderDetails);
-
Using Javascript, how do I do an alert and show the value of a variable?
thanks
-
Thanks for the replies. That cleared up some confusion for me.
I still have a problem though.
Trying to set a variable = to a value in following way, I can't get access to it in a function for some reason. But I konw the variable has a value because If I echo it outside the function I am trying to call it from I get the correct results on the screen.
$colname_rsOrderInformation = "-1";
if (isset($_SESSION['KT_kartOrderId'])) {
$colname_rsOrderInformation = (get_magic_quotes_gpc()) ? $_SESSION['KT_kartOrderId'] : addslashes($_SESSION['KT_kartOrderId']);
}
mysql_select_db($database_t_shop, $t_shop);
$query_rsOrderInformation = sprintf("SELECT * FROM order_ord WHERE id_ord = %s", GetSQLValueString($colname_rsOrderInformation, "text"));
$rsOrderInformation = mysql_query($query_rsOrderInformation, $mx_shop) or die(mysql_error());
$row_rsOrderInformation = mysql_fetch_assoc($rsOrderInformation);
$totalRows_rsOrderInformation = mysql_num_rows($rsOrderInformation);
$test = $row_rsOrderInformation['email_ord']; //email_ord exists in the table and a value will show up if echoed outside of the function but it won't show up with-in the function.
//$test = 'test1'; // If is use this value for the variable, it will show up in the function.
function Trigger_SendEmail(&$tNG) {
$emailObj = new tNG_Email($tNG);
$emailObj->setFrom("orders@acme.com");
$emailObj->setTo("{email_ord}");
$emailObj->setCC("");
$emailObj->setBCC("");
$emailObj->setContent($GLOBALS['test']); //Note: I will get a correct value here if $test is set to anything other then the value of a field from the table
$emailObj->setEncoding("ISO-8859-1");
$emailObj->setFormat("Text");
$emailObj->setImportance("Normal");
return $emailObj->Execute();
}
//end Trigger_SendEmail trigger
What am I doing wrong?
-
I am new to PHP and trying to debug some old code. How am I to read the following:
$properties = $GLOBALS['Props'];
I am guesisin that it is saying:
Create a string variable named $porperties and set it equal to the Global variable of 'Props'.
But I assume my interpretation is wrong since I get some weird results.
-
If I hard code the To address such as a@acme.com into my email function, no problems. But if I try using a variable I get an error. The error doesn't give me any valuable information and is generated from some old code that I never wrote.
If I place the same variable such as "a@acme.com" into any other field such as content, subject I get the value for the variable so I know that it isn't null.
I have tried all the methods of converting to a string and nothing changes.
Any ideas?
-
What is the best way using php to see if a checkbox is checked or not.
I see so many different options out there googling, that I am interested knowing the most robust method.
Thanks
-
Thanks for the replies. I am not normally using PHP (.net instead) and so I may be making some wrong assumptions here. This is some rather old code that I didn't write, and I am trying to fix some things that never worked.
The existing code updates a record like this:
$updRecord_ord->addColumn("firstname_ord", "STRING_TYPE", "POST", "firstname_ord");
I can put any single form variable (i.e. lastname_ord, address_ord) in where the second "firstname_ord" is, and I do not have a problem. But if I try to place a variable that has been concenated instad, I get nothing as a result. No error, just nothing. If I have a name in the firstname field of the textbox, the record gets updated with the first name.
Here is a sample of the code:
$firstname = "firstname_ord". " " . "lastname_ord";
$updRecord_ord->addColumn("firstname_ord", "STRING_TYPE", "POST", $firstname);
firstname_ord and lastname_ord are names of textboxes as well as to have matcing names for columns in a MySQL Table.
They are in a table as such:
<td>
input type="text" name="firstname_ord" id="firstname_ord" value="<?php echo ASescapeAttribute($row_rs_ord['firstname_ord']); ?>" />
</td>
</tr>
<tr>
<td><input type="text" name="lastname_ord" id="lastname_ord" value="<?php echo ASescapeAttribute($row_rs_ord['lastname_ord']); ?>" />
</td>
</tr>
-
I normally don't have a problem with concenation, but for some reason I can't get it work in this case.
I have two form variables: firstname_ord and lastname_ord.
I have tried concenating them several ways, and get nothing afterwards.
attempt 1:
$lastname = "firstname_ord" . " " . "lastname_ord";
attempt 2:
$firstname = "firstname_ord";
$lastname = "lastname_ord";
$fullname = $firstname . " " . $lastname;
attempt 3:
$fullname = "firstname_ord";
$fullname = $fullname. " " . "lastname_ord";
attempt 4:
$fullname = "firstname_ord";
$fullname .="lastname_ord";
attempt 5:
$fullname = (string)"firstname_ord";
$fullname .= " ";
$fullname .=(string)"lastname_ord";
Question on using CSS menuing with unorganized lists and the a tag
in CSS Help
Posted
I have a menu that is derived with CSS and an unorganized list as such:
<ul>
<li id="li1"><a href="#" id="mainMenu1" accesskey="1" title="" class="menuItem1">1</a></li>
<li id="li2"><a href="#" id="mainMenu2" accesskey="2" title="" class="menuItem2">2</a>
<ul>
<li id="li2a"><a href="#" id="mainMenu2" accesskey="2" title="" class="subMenuItem1">2a</a></li>
</ul>
</li>
<liid="li3"><a href="#" id="mainMenu1" accesskey="3" title="" class="menuItem3">3</a></li>
</ul>
When a user hovers over li2 , I have hover css for both the list item (li2) and the a link (menuItem2) working fine. For this particular purpose I want to have different CSS attributes for the li and a tags when hovered over.
When I hover over menuItem2 down to the sub menu item (subMenuItem2), the css hover attributes applied to the higher level li (li2) stay, but the they disappear for the a link (subMenuItem1) defaulting back to the default a CSS attributes.
What do I do in CSS to have the attributes stick for the a tag in this particular situation when hovering over a lower level list item?
Thanks