instead of requesting:
$url='http://example.com/vast/1/73188';
try requesting
$url='http://example.com/vast/1/73188?cb=' . time();
instead of requesting:
$url='http://example.com/vast/1/73188';
try requesting
$url='http://example.com/vast/1/73188?cb=' . time();
I understood what you wrote, however, keywordID may NOT be a column bulbTable. I think it is clear now that 1 "represents" '60 Watt' but what if I were to enter the ID zero as a value of keywordID! In reality, the column keywordID should have ONLY numeric values that exist in the id column of Keyword table. The DB itself can enforce this "Requirement" but you can only have one value per record. So imagine that your "bulbTable" SHOULD be like this instead:
bulbTable
============
bulbID bulbName keywordID
1 GE 1
1 GE 2
1 GE 3
2 Sony 2
2 Sony 3
3 Osram 1
3 Osram 3
However, since bulbID is unique, the db will NOT allow it. So what you need to do is use a third table that will contain the (many-to-many) relationship:
bulbTable
bulbID buldName
1 GE
2 Sony
3 Osram
bulbKeywordTable
bulbID keywordID
1 1
1 2
1 3
2 2
2 3
3 1
3 2
Look up articles pertaining to db data normalization. IF you go to http://en.wikipedia.org/wiki/Database_normalization, under "Normal Forms" you will find a table with each of the normal forms - each of which is a link to an article. Read them all.
The owner of the company I am working for misspelled those words on purpose.
Understood.
Again, if i were to remove the keywords column and place them in another table, no two keywords fields are exactly alike,...
agree, but you are taking into consideration/seeing the ENTIRE list of keywords per record. What I am envisioning is that there may be more than one record which may have "60 watt" - ex:
Bulb
====
id ...
1 ...
2 ...
Keyword
=======
id description
1 60 watt
2 replacement
3 halogen
BulbKeyword
=============
Bulb_id Keyword_id
1 1
1 2
2 1
2 3
notice that Keyword_id=1 appears for two different bulbs. Just as an example, imagine that during development (of the site you are working on) 60W is what is intendended and you build all the pages of your site, and all the pages that are supposed to have 60W are complete. Then right before "deployment" it turns out that it it should be 80W instead of 60W!
If you were to break the list above at the commas, you are basically left with a list of tokens (regardless of how many words within each token). Now the question: Is it guaranteed that each token will be used only once? If yes, then your one-to-one statement is true. Otherwise you should break it down as suggested. I hope this sheds some "light" [pun intended :)] in the matter.
try:
if( isset($_POST['Submit']) && $_POST['Submit']=='Submit' )
{
foreach($_POST['GP1011_wk1'] as $playerID=>$v)
{
//initialize to empty string and add field=value only if something was submitted
$update="";
$GP1011_wk1=mysql_real_escape_string( trim($_POST['GP1011_wk1'][$playerID]) );
$PTS1011_wk1=mysql_real_escape_string( trim($_POST['PTS1011_wk1'][$playerID]) );
if( !empty($GP1011_wk1) ) {
$update.="`GP1011_wk1`='" . $GP1011_wk1 . "'";
}
if( !empty($PTS1011_wk1) )
{
$update.=",`PTS1011_wk1`='".$PTS1011_wk1."'";
}
if(!empty($update))
{
$update = 'UPDATE `stats1011` SET '. $update . " WHERE `playerID` ='".$playerID."'";
mysql_query($update) or die( sprintf('Error @Line %d while trying to execute<br/>%s<br/>%s',__LINE__,$update, mysql_error() ) );
}
}
}
// Get all the data from the "player" table
error_reporting (E_ERROR);
$GETQ="SELECT
Sum(stats1011.GP1011_wk1+stats1011.GP1011_wk2+stats1011.GP1011_wk3+stats1011.GP1011_wk4+stats1011.GP1011_wk5+stats1011.GP1011_wk6+stats1011.GP1011_wk7+stats1011.GP1011_wk8+stats1011.GP1011_wk9+stats1011.GP1011_wk10+stats1011.GP1011_wk11+stats1011.GP1011_wk12+stats1011.GP1011_wk13+stats1011.GP1011_wk14+stats1011.GP1011_wk15+stats1011.GP1011_wk16+stats1011.GP1011_wk17+stats1011.GP1011_wk18+stats1011.GP1011_wk19+stats1011.GP1011_wk20+stats1011.GP1011_wk21+stats1011.GP1011_wk22+stats1011.GP1011_wk23+stats1011.GP1011_wk24+stats1011.GP1011_wk25+stats1011.GP1011_wk26) AS `GP_TTL_1011`,
Sum(stats1011.PTS1011_wk1+stats1011.PTS1011_wk2+stats1011.PTS1011_wk3+stats1011.PTS1011_wk4+stats1011.PTS1011_wk5+stats1011.PTS1011_wk6+stats1011.PTS1011_wk7+stats1011.PTS1011_wk8+stats1011.PTS1011_wk9+stats1011.PTS1011_wk10+stats1011.PTS1011_wk11+stats1011.PTS1011_wk12+stats1011.PTS1011_wk13+stats1011.PTS1011_wk14+stats1011.PTS1011_wk15+stats1011.PTS1011_wk16+stats1011.PTS1011_wk17+stats1011.PTS1011_wk18+stats1011.PTS1011_wk19+stats1011.PTS1011_wk20+stats1011.PTS1011_wk21+stats1011.PTS1011_wk22+stats1011.PTS1011_wk23+stats1011.PTS1011_wk24+stats1011.PTS1011_wk25+stats1011.PTS1011_wk26) AS `PTS_TTL_1011`,
`stats1011`.`Last`,
`stats1011`.`First`,
`stats1011`.`playerID`,
`stats1011`.`Pos`,
`stats1011`.`No`,
`stats1011`.`GP1011_wk1`,
`stats1011`.`PTS1011_wk1`,
`stats1011`.`Team`
FROM
`stats1011`
WHERE
`stats1011`.`Team` = 'tor'
GROUP BY
`stats1011`.`playerID`
ORDER BY
field(pos,'LW','C','RW','D','G'), last";
$result = mysql_query($GETQ)
or die(mysql_error());
The advantage is that in BulbKeyword you would NOT use the actual words, but the ID. So if SOMEONE else were to notice that you misspelled the word "light" (case in point, like you did above ...100K19/DL lihgt ligth lightbulb...
), then you would just need to fix it one in the Keyword table instead of "hunting down" the error in every record in Bulb.
This is just a recommendation; it's not a "requirement", so it is ultimately up to you.
If I were to follow what I think the other forum is suggestion, I would need to put each keyword in a separate table or column?
A column, NOT a table. And yes, that is exactly what I would do.
[B]Bulb[/B]
id
...
[B]Category[/B]
id
name
[B]
Keyword[/B]
id
name
/* Here you record the ids, NOT the actual name of the category. If you make a typo in the category name, then you just fix the typo in the Category table, but the BulbCategory table would be unaffected. The same rationale goes for the BuldKeyword table.*/
[B]BulbCategory[/B]
Bulb_id
Category_id
[B]BulbKeyword[/B]
Bulb_id
Category_id
Did you try to create as couple of NEW parent an child tables and test it?
If the integrity contraints between Table A and Table B fail in your PHP script it MUST fail in PHPMyAdmin. Likewise,
If the integrity contraints between Table A and Table B succeed in PHPMyAdmin, it MUST succeed via your own PHP script.
The only way your statement (that it works in one but not in the other) makes sense to me is if in PHPMyAdmin you are testing Table A with Table B, but in your script you are testing Table C with Table D!
your problem is because your HTML markup is INVALID. For example, find your first <TR>
element. You have not stated where the <TABLE>
begins!
Here's another example. If you were to add <table>
to fix the problem I mentioned above, then you have: <div><span id='writedist'></span></div>
as a child of <table>
. A <table>
tag cannot have a <div>
as a child. You need to put that <div>
into a <td>
, but that <td>
needs to be in a <tr>
Go to http://validator.w3.org, and click on "Validate by direct input", then paste your html. Fix all the errors outlined there and then your page should work.
Adding a second column is really NOT the ideal approach/solution. What if you add more groups and a person needs to belong to many groups.
What you need to do is to add a table to list the groups and another table that holds the membership info:
Person
id firstName lastName
1 John Smith
2 Sally Jones
Group
id name
1 Directors
2 UK Sales
3 Marketing
PersonGroup
Person_id Group_id
1 1
1 2
2 3
Your query would be:
$sql=sprintf("SELECT p.id as personId, p.firstName, p.lastName
FROM Person p INNER JOIN PersonGroup pg ON p.id=pg.Person_id
INNER JOIN `Group` g on g.id=pg.Group_id
WHERE gp.id=%d", intval($var) );
i basically have a back end site php/mysql with clients addresses etc, i need to be able to send that data to another site where they have login and passord for and it pre populate the forms in the other site as best as it can.
but then you said "thanks however i dont have any control over the site." If you have zero control over their site, you cannot populate the fields yourself. The closest you can do is, IF their site already has a form in place that is expecting the other data (like first and last name etc) then you can first retrieve the data from your site and post it theirs.
No. You can use OR to determine if at least one of them is null: SELECT * FROM `tableName` WHERE (`column1` IS NULL) OR (`column2` IS NULL) OR (`column3` IS NULL) OR (`column3` IS NULL)
, etc. Just change column# with the actual names of your columns
try echo stripslashes($_POST['content']);
Then instead of selecting ALL the records, select only the ones that are null:
SELECT * FROM `tableName` WHERE `columnName` IS NULL
Can u plz explain what is different between normal engine and INNODB
In MySQL, foreign key constraints will only work on INNODB and BDB engines. The online manual explains the engines in details.
If your tables already have data, and the existing data violate the integrity contraints, then the changes you tried to make will not work.
Suggestion: make a test parent and child table and try again. Assuming the parent table has PRIMARY KEY id INT(10), then the child table MUST have data type INT(10) as well. IT cannot be INT(20) [or any other number other than 10]
Verify that the query is executing successfully. Instead of $query=odbc_exec($conn,$sql);
try $query=odbc_exec($conn,$sql) or die( odbc_errormsg($conn) );
In validateAddUserForm() you are using $error .= ...;
but you have not initialized $error. Initialize it at the very top of your function (before the if clause). If you are still not seeing anything, begin adding echo sprintf('%s(): %s',__FUNCTION__,__LINE__);
statements throughout your function(s) so find out which lines are actually being executed.
Also, in addUser() you have if($group = "Student")
. You MISSED an equal sign.
Try enclosing the names in apostrophes - 'smith, james'; 'beckam, david'
are you being redirected to contractorlogin.php at least? Assuming you are, then in contractorlogin.php you MUST be storing the username in a session.
As for the code you posted, you may want to use an EQUAL instead of a LIKE in your query:
<?php
session_start();
if (!isset($_SESSION['memberusername'])){
header("Location: contractorlogin.php");
exit();
}
mysql_connect('localhost','username','password') or die( mysql_error() );
mysql_select_db('dbname') or die( mysql_error() );
$user = mysql_real_escape_string($_SESSION['memberusername']);
$sql = "SELECT * FROM contractors WHERE Username='" . $user . "'";
$result = mysql_query($sql) or die( 'Unable to execute<br>'.$sql.'<br>'.mysql_error());
if( !mysql_num_rows($result) )
{
echo '<p>No Records found!</p>';
}
else
{
$row=mysql_fetch_assoc($result);
echo '<table><tr><th>' .implode('</th><th>', array_keys($row) ).'</th></tr>';
do
{
echo '<tr><td>'.implode('</td><td>',$row).'</td></tr>';
}while($row=mysql_fetch_assoc($result));
echo '</table>';
}
?>
If the tables already exists, make sure that:
-BOTH are using INNODB engine.
-In both tables, the fields are of the same type and size ( ex : INT(10))
then try:
ALTER TABLE `childTableNameHere`
ADD CONSTRAINT `parentTableNameHerechildTableNameHere`
FOREIGN KEY (`parentTableNameHere_primaryFieldNameHere` )
REFERENCES `parentTableNameHere`( `primaryFieldNameHere` )
What browser are you using? What's the url to your page?
..i tried your code and edited the areas you specified
I'm not clear on what you "edited". I gave you a copy and paste post. I was expecting you to backup your original first, then copy and paste what I posted.
I have a row that has the value Moulin Rouge, and another row that has the value Rogue.
Well, Rouge!=Rogue
This is something you should do from the server dynamically. Do you have PHP?
the easiest approach would be to "instruct" your form to send it directly to google:
<form method="get" action="http://www.google.co.uk/search">
<input type="hidden" name="btnG" value="Google Search"/>
<input type="text" name="q" value=""/>
<input type="submit" name="submit" value="Submit"/>
</form>
and if you want it in a new window:
<form target="_blank" method="get" action="http://www.google.co.uk/search">
...
</form>
Now, if you want to do this from your server using php, assuming your form has a field with name="q"
:
<?php
if( isset($_GET['q']) && !empty($_GET['q']) )
{
header('Location: http://www.google.co.uk/search?'.urlencode($_GET['q']) );
exit;
}
?>
on my previous post, I forgot to include the css for the tables, but the background does show up for me:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>~~~FeedTitle~~~</title>
<meta name="description" content="~~~FeedDescription~~~">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link href="http://www.feedforall.com/rss2html/ffa-29.css" rel='stylesheet' type='text/css'>
<style type="text/css">
a {
font-size: 30px;
}
.a font {
text-align: center;
}
body {
background: #FFFFFF url('http://www.backgroundlabs.com/backgrounds/358.gif') scroll repeat top left;
}
table{background-color:white;}
</style>
</head>
<body>
<img src="http://www.316apps.com/headerlogo.png" width="965" height="203" />
<h1 align="center" class="a"><b>~~~FeedTitle~~~ </b></h1>
<table width="100%" border="1" cellspacing="0" cellpadding="8" align="center" bordercolor="#333333">
<tr valign="center" bgcolor="#F4F4F4">
<td width="88%" height="2" class="a"><font size="+6"><CENTER>~~~FeedDescription~~~</CENTER></font></td>
</tr>
</table>
<span class="a"><br />
~~~BeginItemsRecord~~~ ~~~FeedMaxItems=50~~~
</span>
<table width="75%" border="1" cellspacing="0" cellpadding="10" align="center" bordercolor="#666666">
<tr valign="top">
<td height="47">
<table width="100%" border="0" cellspacing="0" cellpadding="15" align="center">
<tr valign="top" bgcolor="#F4F4F4">
<td height="23" width="50%">
<p class="a"><span class="cc"><b><font size="+5">~~~ItemPubShortDate~~~</font></b> <a href="~~~ItemLink~~~">~~~ItemTitle~~~</a></span></p>
</td>
</tr>
<tr valign="top">
<td height="17" width="50%"><span class="cc"> <span class="a"><font size="+5">~~~ItemDescription~~~</font></span></span></td>
</tr>
</table>
</td>
</tr>
</table>
<p><span class="a">~~~EndItemsRecord~~~ </span>
<p align="center">copyright Company Name 2006 all rights reserved; <br />
<font size="-6">rss2html template created by <a href="http://www.feedforall.com">FeedForAll</a><br />
</font> </p>
</body>
</html>
try:
<?php
include_once('inc/functions.php');
// Get the search variable from URL
$var = @mysql_safe($_GET['q']) ;
$trimmed = trim($var); //trim whitespace from the stored variable
// rows to return
$limit=10000;
// check for an empty string and display a message.
if ($trimmed == "")
{
$error = "<tr><td colspan='2' style='text-align: center; border-style: solid; border-color: #f43636; background-color: #fe6a6a;'><strong>Type In A Sheet To Search For</strong></td></tr>";
}
// check for a search parameter
if (!isset($var))
{
$error = "<tr><td colspan='2' style='text-align: center; border-style: solid; border-color: #f43636; background-color: #fe6a6a;'><strong>Type In A Sheet To Search For</strong></td></tr>";
}
// Build SQL Query
//$query = "select * from sheets where artist like \"%$trimmed%\" OR title like \"%$trimmed%\" order by artist";
//#LIKE_PART# is just a temporary place holder
//IMPORTANT: Since you are doing 'AND' BEFORE the #LIKE_PART#, you MUST have parentheses around #LIKE_PART#
$query = "select * from `sheets` where `active`='yes' AND (#LIKE_PART#) ORDER BY `artist`";
//here you call function to build LIKE expression per field
$q[]=buildLike($trimmed,'`artist`');
$q[]=buildLike($trimmed,'`title`');
//here you join the LIKE expressions above with 'OR'. Ultimately $q ends up with:
// ( (`artist` like 'term1') OR (`artist` like 'term2') OR (`artist` like 'termN') )
// OR
// ( (`title` like 'term1') OR (`title` like 'term2') OR (`title` like 'termN') )
$q=implode('OR', $q);
//echo $q;
//here you replace that #LIKE_PART# with the actual LIKE expression
$query = str_replace('#LIKE_PART#', $q, $query);
//echo $query;
$numresults=mysql_query($query);
$numrows=mysql_num_rows($numresults);
// If we have no results, DISPLAY ERROR LETTING USER KNOW THE SHEET WAS NOT FOUND. INCLUDE LINK TO ALLOW THEM TO REQUEST SHEET
if …
OK, then other alternatives are to ACTUALLY list the fields that you are trying to select. Make sure you read ALL this post BEFORE you attempt the suggested changes:
Instead of SELECT * FROM...
use:
/*
NOTE: Date is typically a built-in function OR a keyword in DBs, so you need to use the [] around it so that it is acknowledged as YOUR field name not as the built-in function/keyword.
On the query below, I don't know if 'Date' (uppercase "D" in SELECT) and 'date' (lowercase "d" in ORDER BY) are the same. If yes, try using the exact letter case (uppercase or uppercase) you have in your Table definition, AND Prefix them with the tableName on which they are defined. My guess was that they are in Module table, but if not, then provide the correct table name
*/
$sql="SELECT [Module].[Module Name] as [moduleName], [Module].[Date], [Employee].[EmployeeClassName]
FROM Module INNER JOIN (Trainings INNER JOIN ((Employee INNER JOIN EmployeeClassName ON Employee.ClassID = EmployeeClassName.ClassID) INNER JOIN [Training Details] ON Employee.EmployeeID = [Training Details].[Employee ID]) ON Trainings.[Training ID] = [Training Details].[Training ID]) ON Module.ModuleID = Trainings.[Module ID] where [Full Name]='$username' order by [Module].[Date] desc";
With the changes above, you should be able to use either:
$trainings=odbc_result($query,"moduleName");
OR
/*
http://php.net/manual/en/function.odbc-result.php
[I]field:[/I]
The field name being retrieved. It can either be an integer containing the column number of the field you want; or it can be a string containing the name of the field.
[I]Notes:[/I]
Field indices start from 1...
*/ …
you need the brackets when formulating the SQL command only. Once the query executes successfully, the BRACKETS are NOT needed. Try: $trainings=odbc_result($query,"Module Name");
leave you SQL as is (WITH the brackets).
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title><font size="+4">~~~FeedTitle~~~</font></title>
<meta name="description" content="~~~FeedDescription~~~">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link href="http://www.feedforall.com/rss2html/ffa-29.css" rel='stylesheet' type='text/css'>
<style type="text/css">
a {
font-size: 30px;
}
.a font {
text-align: center;
}
body {
background: #FFFFFF url(http://www.backgroundlabs.com/backgrounds/358.gif) scroll repeat top left;
}
</style>
</head>
<body>
...
using http://www.dustindiaz.com/getelementsbyclass/
try:
if( !document.getElementsByClassName )
{
document.getElementsByClassName=function(searchClass,node,tag) {
var classElements = new Array();
if ( node == null )
node = document;
if ( tag == null )
tag = '*';
var els = node.getElementsByTagName(tag);
var elsLen = els.length;
var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
for (i = 0, j = 0; i < elsLen; i++) {
if ( pattern.test(els[i].className) ) {
classElements[j] = els[i];
j++;
}
}
return classElements;
}
}
var bustcachevar=1 //bust potential caching of external pages after initial request? (1=yes, 0=no)
var loadedobjects=""
var rootdomain="http://"+window.location.hostname
var bustcacheparameter=""
function ajaxpage(url, containerid){
var page_request = false
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
}
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
page_request.onreadystatechange=function(){
loadpage(page_request, containerid)
}
if (bustcachevar) //if bust caching of external page
bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
page_request.open('GET', url+bustcacheparameter, true)
page_request.send(null)
}
function loadpage(page_request, containerid){
container=containerid;
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
{
if( typeof(container)=='string' )
{
container=container.replace(/^\s+|\s+$/g,'')
if(container.charAt(0)==".")
{
container=document.getElementsByClassName(container.substring(1));
container=container?container[0]:null;
}
else if(container.charAt(0)=="#")
{
container=document.getElementById(container.substring(1));
}
else
{
container=document.getElementById(containerid);
}
}
if(container)
conainer.innerHTML=page_request.responseText
else
alert("unable to locate specified container: " + containerid);
}
}
function loadobjs(){
if (!document.getElementById)
return
for (i=0; i<arguments.length; i++){
var file=arguments[i]
var fileref=""
if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
if (file.indexOf(".js")!=-1){ //If object is a js file
fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript"); …
what error message did you get?
http://us2.php.net/manual/en/function.mssql-get-last-message.php
...
mssql_select_db('dbname') or die('MSSQL error: ' . mssql_get_last_message());
again if you are using MS Access:
SELECT [First Name] FROM [Users Table]
but in MySQL:
SELECT `First Name` FROM `Users Table`
use notepad and save the text with ANSI encoding. If you have a utf-8 encoded file, chance are there are some leading characters being sent to the browser before the header() function sends its output.
i've tried using bactick character but it failed.
Then you either are NOT using MySQL OR you probably used apostrophes instead of backticks. The backtick (`) is the one on the same key as the ~ character.
$sql = sprintf("UPDATE sheets SET artist = '%s', title = '%s', active = '%s' WHERE id=%s "
,mysql_real_escape_string($artist)
,mysql_real_escape_string($title)
,mysql_real_escape_string($activestatus)
,mysql_real_escape_string($value)
);
$result = mysql_query($sql) or die(mysql_error().'<br>'.$sql);
That was easy!
:)
For your script to work, you need to use the header() function in order to send the proper headers. However, it will NOT work if you send ANY output before you call header - ex:
<?php //WRONG: There is space BEFORE the php opening tag
header(...);
...
?>
In your case, currently I am seeing:

which is typically found in utf-8 encoded files, so it is probably the text editor you are using. To clarify, basically the actual content of your php file is most likely:
<?php //WRONG: Those characters are sent to the browser before the header() output is sent
header(...);
...
?>
So, take your php code above, paste it onto Notepad and when you are saving it choose ANSI encoding. THEN upload the file again. (You may have to do the same procedure for the other php file - reg_dbc.php).
I already told you that this:
list($name, $type, $size, $content) = mysql_fetch_array($result);
needs to be using mysql_fetch_assoc()
, even if you get a blank screen. The blank screen is due to some other issue.
In your case, if you open firefox, go the link you provided, then click on test.php. Press CTRL+U.
Do you see that HTML <table> markup? That is your problem. You cannot send ANY output to the browser before the header() calls. Somewhere you are sending what looks like "debugging" information in a "tabular" HTML format. My guess is reg_dbc.php.
For purposes of debugging, INSTEAD of reading from an XML file, have you tried simply sending a some "hardcoded" XML:
<root><test>testing</test></root>
just to verify that everything else is correct. If it works, then it is likely not able to locate the file.
...javascript is ok ?
again, the only issue with the ORIGINAL ajax code you posted is that it is NOT sending a post request, BUT your servlet is expecting a POST. You need to also include what I gave you on post Sep 15th, 2010, 22:10 for your ajax to send the request as POST.
Open FF, and install the following:
https://addons.mozilla.org/en-US/firefox/addon/60/
Restart FF and then open your page. Once your page loads, on the developer bar click on "Information > View Javascript"
You should see ALL the javascript code of that page OR an error indicating if the file did not load.
Make sure all the js is loaded properly. It seems to be working fine for me when I linked to the cookie.js file AND I used
$('#tabs').tabs({cookie:{expires:30}});
on the non-working code, these:
$renderjcrl = $renderjcrl . '<div id=\"carousel-cars-horiz\">';
$renderjcrl = $renderjcrl . '<ul id=\"carousel-cars\" class=\"jcarousel-skin-tango\">';
will end up sending
id=\"....\"
to the browser - meaning, the browser will get the backslash AND the double quotes because (unlike your first code) your overall string is enclosed in apostrophes, NOT in double quotes. You need the back slashes if you had double quotes around the div.
So you need to use either:
a.enclose the div in double quotes
$renderjcrl = $renderjcrl . "<div id=\"carousel-cars-horiz\">";
$renderjcrl = $renderjcrl . "<ul id=\"carousel-cars\" class=\"jcarousel-skin-tango\">";
OR:
b. leave the apostrophes around the div, but get rid of the backslashes
$renderjcrl = $renderjcrl . '<div id="carousel-cars-horiz">';
$renderjcrl = $renderjcrl . '<ul id="carousel-cars" class="jcarousel-skin-tango">';
my previous comment has a direct link to it (I just updated it).
It will show you, whatever it is you are putting in the VALUE
of each <OPTION>
. If you want more than that, you can create a delimited value. For example, if you wanted the $stuendrow AND the $row, then make your value something like value="34_23" and when you get that on the server, use the explode() function to break it at the "_":
echo sprintf('<option value="%s_%s">%s %s %s</option>'/*each of those %s will be substituted (left->right) with the following:*/
,htmlentities($studentrow,ENT_QUOTES)
,htmlentities($row['studentID'],ENT_QUOTES)
,htmlentities($row['studentID'],ENT_QUOTES)
,htmlentities($row['firstName'],ENT_QUOTES)
,htmlentities($row['lastName'],ENT_QUOTES)
);
Just need to know how to rank in google , I have done keywords , but its not coming up and not sure what I am doing wrong.
I don't know, but that is a completely different issue that is perhaps more suitable if posted under "Internet Marketing > Search Engine Optimization"
Read ALL my comments on my post from Sep 20th, 2010, 23:43
http://plugins.jquery.com/files/jquery.cookie.js.txt
Be sure to save it as a js file
I noticed your source code on the original post, but I don't have all those file you are using nor an available server to upload them to.
On another note, I clearly stated that you should be including the jquery COOKIE plugin. I don't see that in your code anywhere. Without it, my previous suggestion will never work.
No. What I meant was that you opened your HTML <SELECT ...>
tag, but you did NOT close it ( </SELECT>
)
Is this a mime-type issue in the header section?
It sure sounds like it. On line 11, try changing:
mysql_fetch_array($result)
to:
mysql_fetch_assoc($result)
You need to close your SELECT. Then to read the selected value upon post:
if( isset($_POST) && !empty($_POST))
{
$userSelected = $_POST['studentrow'];
}