hericles 289 Master Poster Featured Poster

Is this PHP? The function should be seperating the string into tokens based on the delimiter. In your example 'greeting pe' would become the first token of the tokenised string. The example from the PHP man page may help.

<?php
$string = "This is\tan example\nstring";
/* Use tab and newline as tokenizing characters as well  */
$tok = strtok($string, " \n\t");

while ($tok !== false) {
    echo "Word=$tok<br />";
    $tok = strtok(" \n\t");
}
?>

As you can see, $tok is used repeatedly to move through the string. SO if you did a loop like the one above further calls to strtok should move through your string.

hericles 289 Master Poster Featured Poster

You aren't using an ON criteria so you're getting a CROSS JOIN of the two tables, which is a cartesian product. That's why you are seeing rows duplicated. Adding an ON clause will fix it up.

hericles 289 Master Poster Featured Poster

Have the default CSS class set as you like it to be and remove that class when you the error class
$('#lblResult').removeClass('default');
That class will be used unless the label contains the word error.

hericles 289 Master Poster Featured Poster

You can use jQuery on the client side to watch the label and when its text changes look to see if thw value contains "error". Based on the result, alter the css class of the label

$(document).ready(function() {
    $('#lblresult').change(function() {
        if($('#lblResult').val().indexOf("Error") >= 0) {
            $('#lblResult').addClass('warning');
        }
    });
});

You'd need to create the warning CSS class of course.
I haven't tested that code but it should pretty close to what you need.

hericles 289 Master Poster Featured Poster

In your submit_click function use:
$("#submit").prop('value', 'submitting');
And, of course, if validation fails, use the same line again to reset the value of the button to 'submit'.

hericles 289 Master Poster Featured Poster

If the table rows get deleted and you want to reset the primary key just use TRUNCATE mytable;

hericles 289 Master Poster Featured Poster

Your're only updating one column in table br here. You can use joins like this to update 2 tables but you'd need to include the second column of the second table in the SET part of the command.
To be perfectly honest, the entire command is a bit wrong for a UPDATE statement. You don't the FROM for example.
The mysql docs might be useful Click Here

hericles 289 Master Poster Featured Poster

just go with

#admin {
    border: 1px solid #f6f6f6;
}

Seeing as you have already specified an ID you don't need to include the table selector. It means the CSS is trying to style a table that is a child of #admin

hericles 289 Master Poster Featured Poster

This isn't all of your code is it? Where are you defining $alert and what is it?
If $obj is an array then you need to delve into it to get the data you want.
If you're unsure of the format of the array use var_dump($obj) to view it on screen.

hericles 289 Master Poster Featured Poster

This should work:

If isset($_GET['id']){
        $productID = $_GET['id']
    }

What errors are you getting if you check the $_GET variable exists before calling it?

hericles 289 Master Poster Featured Poster

Do you mean swipe?

hericles 289 Master Poster Featured Poster

Although you are setting a session you aren't putting anything into, or passing values via the form.
This means that on each page reload $_randNum isn't set as the page is 'new' and has no variables being passed to it or being retrieved from the session.
To add the rand number to the session:
$_SESSION['rand'] = $_randNum;
To retrieve:
if(!isset($_SESSION['rand']))

hericles 289 Master Poster Featured Poster

You never initilise scoreCount so any instances of
scoreCount++;
will fail. You need to include
int scoreCount = 0;
at the start (as you have done for totalScores.
And scoresArray is declared as scoreTotalsArray so you just have the variable name wrong on line 106.

hericles 289 Master Poster Featured Poster

I'm not sure how getting the integer value at the start of the addBtn_Click method and checking if it is between 0 and 100 could fail.
Could you post up the code section where you make the check (by which method mentioned above)?

hericles 289 Master Poster Featured Poster

You could always create a class or struct and then you could use notation like:
user.name, user.email.

You could use a dictionary and enter key/value pairs.
Or, if you REALLY wanted it to look and operate like your example you could create a datatable or datarow with the columns named appropriately. Then you get exactly
user["name"], user["email"], etc if that is a requirement.

hericles 289 Master Poster Featured Poster

In the addBtn_Click, where you are checking that a value has been entered, you can also check the value is between 0 -100.

int value = Int.Parse(scoreTxb.Text);
if(value < 0 || 100 < value) {
   // error
}

If you are worried about potentially bad input Int.TryParse might be a good idea too.

hericles 289 Master Poster Featured Poster

You'll need PHP installed, apache and most likely MySQL. All of those come in the Xampp package for windows, whic you can get from here
It's a lot easily than installing them separately

hericles 289 Master Poster Featured Poster

You will need to add the ability for the user to specify a location before reaching that code section. A file dialog will work. They can then locate the location they want to save and, on clicking the export button, the directory location becomes a variable that is inserted into the command text.

hericles 289 Master Poster Featured Poster

The problem is that you are using
header("Location: index.php");
at line 108.
The header command cannot have any output before it on the page. PHP is fine of course but the minute you put any HTML before it you run into problems. You will either need to relocate your code or use output buffering (google will help).

hericles 289 Master Poster Featured Poster

So is this the version that works? What do you add to it that makes it stop working?

hericles 289 Master Poster Featured Poster

Have there been any changes to the machine? is the server instance stilling if you look for it in services via task manager?

hericles 289 Master Poster Featured Poster

=LEFT(text, length) should be what you are after

hericles 289 Master Poster Featured Poster

The repeater control is the right way to go. The only thing I would suggest is to think about how you want the image link to work. Personally, I would include the member ID for the photo in the link so the profile page reads the ID from the POST or the query parameters and uses that to extract the data from the database.
e.g. the naviagte URL for the image might be href='profile.aspx?id=109'

hericles 289 Master Poster Featured Poster

If you only have the two colours, the easiest thing to do is change the background to the default colour for all LI's and then adjust the colour for the one that was clicked using this.

hericles 289 Master Poster Featured Poster

The most obvious problem is that you are breaking on the space between first and last name as well.
But when you create your client object you want to pass in the relevant strings from the array. In its most basic form it would look like this:

string input = f.ReadLine();
string[] words = input.split(" ");
Customer client = new Customer(words[0].toString(), words[1].ToString() + " " + words[2].toString(), words[3].toString());

But that assumes a first and last name and never less or more than that so it isn't very robust. You could look as a CSV (comma separated value) file and then split on the comma to avoid that.

Anyway, hope that helps.

hericles 289 Master Poster Featured Poster

Is the sql server configured for remote access?
If it is a named instance you need to have sql server browser running to be able to locate the name instance (not an issue if you're using default naming).
Have you got a user with appropriate rights that you can include in the connection string?

hericles 289 Master Poster Featured Poster

I would build an intervening table that holds the student ID and the course ID and nothing else (OK, you might have a reason to put in some other columns but you get the idea). It is simply a list of the courses a student is enrolled in.

hericles 289 Master Poster Featured Poster

looks to me like this line is the problem:

Product product = new Product("200.00", 0);

In your product class the first parameter of your constructor is the name as a string, the second is the price. So you want the price to be the second parameter when creating the class and, in your constructor, include
this.price = price;
By passing in zero, you're getting zero back.

hericles 289 Master Poster Featured Poster

I could only try it once before liveweave failed to reload it but the most obvious problem was that the validation check on the button still ran, checkig to see if I had added a value into the textbox. You'll want to disable that when the text of the button is 'start new game'.

hericles 289 Master Poster Featured Poster

'most freelancers...sit in an office in some customer's building 10+ hours a day, working harder than anyone else, for less pay than the employees'
That sounds more like a contractor to me.

hericles 289 Master Poster Featured Poster

Having done both I can tell you freelancing comes with a reasonable set of problems, the worst of which are:
locating new clients/winning new work
uneven income stream
dealing with clients (billing, disputes, etc)
loneliness (don't knock it, this one is important)

But the pros are:
being your own boss and working your own hours
personal staisfaction
better lifestyle in general (money issues aside)

I loved being able to code for a couple of hours in the morning, take most of the day off (gym, take dogs for a run, that kind of stuff) if there were no clients to meet, and then work again at night (I'm more productive then).
But the wobbly cash flow and stress were definite downsides as was the social exclusion. You don't realise how much chatting to people with similar passions/intellects matters until you're going solo.

It's freedom vs safety really. Pick the one you want more.

iamthwee commented: agreed +14
hericles 289 Master Poster Featured Poster

If you need to define the size of an array you can use :

ReDim Preserve array_shuffle(20);

You can use that is the methods that specify the array a size.
Preserve isn't necessary but it allows you to keep elements already specified if you've loaded some or all of the array. Data loss occurs if you redim to something smaller of course.

hericles 289 Master Poster Featured Poster

Valid point.

hericles 289 Master Poster Featured Poster

Well, checking the error log is the best but if you need to you can use var_export or echo to output a string of text. If you can see that text when you run the page you know you at least got to that point.
echo 'here';
If you view the source of the page do you see anything? You're including home/example.com as both header elements and content of the page so what exactly is it? Is it possible that the page is constructing itself correctly and just happens to be empty?

hericles 289 Master Poster Featured Poster

Is your PHP error log error free as well?
Echo out so text to see if you can determine where it is failing if the logs don't help you.
And what is that you are trying to include (home/example.com)? What file type is and what is it meant to do?

hericles 289 Master Poster Featured Poster

If you aren't filtering the query at the PHP end based on $givenCity then I might try something like:
SELECT * FROM highschools WHERE city like '%$givenCity%';
That will select all matches like the given city (including matches that included the given city as a substring (I'm not sure if that will actually be a problem) or any strings that include an empty string as a substring - which is all of them.
So you feed in $givenCity as either a city or ''.

hericles 289 Master Poster Featured Poster

Hmmm, in your nib have you dragged another view over the entire window? It looks like there might be something on top the bottom layer which is white and that is blocking you from seing the parent view's color.
Just a thought...

hericles 289 Master Poster Featured Poster

I would have thought that was enough. Have you tried putting that line in the if(self){} section of initWithNibName?

hericles 289 Master Poster Featured Poster

From your example it looks like you want the distinct values from the table

SELECT DISTINCT COL_NAME1, COL_NAME2 FROM...

But I doubt that is it. What exactly do you need?

hericles 289 Master Poster Featured Poster

Your console.log line isn't getting hit because the code is failing at the http.get line. When AngularJS itself hits an error the location of the error shown in the console often isn't of much use.
I used a JSON validator found here and loaded up your JSON. Two errors were found. If you do the same you can easier track them down and see whats wrong.

hericles 289 Master Poster Featured Poster

The console log doesn't give you any hints? Have you put a console.log in your second controller to make sure it is getting called correctly (although I can't see why it wouldn't be)?
And is your hotelinfo.json file named correctly and error free?

hericles 289 Master Poster Featured Poster

You have two errors in your code. Change line 20 to:
var userTrials = document.getElementById("userGuesses");

Firstly, its getElementById, camelcase for all words. Secondly, you don't want the innerText portion of the userGuesses div, you just want the div itself.
Thirdy, find a new professor.

hericles 289 Master Poster Featured Poster

Your last post triggered my memory some more and I remember having a similar problem. I just checked my set up on my dev machine and its httpd-2.4.9-win32-VC9 and PHP 5.5. I think I tried the 64bit route and then gave up, been a while since I set it up.
Is there anything coming up in your logs?

hericles 289 Master Poster Featured Poster

Flowers would lose their romantic appeal to the fairer sex pretty quickly.
Nothing says 'I love you' like a single, squealing, red rose.

hericles 289 Master Poster Featured Poster

I'm a bit rusty on WHEN NOT but I think it needs to be
WHEN NOT MATCHED THEN INSERT INTO

hericles 289 Master Poster Featured Poster

You can, as long as the languages you use have connection drivers available for the particular database you intend to connect to, which in your case you know it does.

hericles 289 Master Poster Featured Poster

Is this on a 64bit Windows machine? If yes, you need to make sure you have the right versions of Apache and PHP. ApacheLounge.com can help you out with the right 64bit downloads.
If that was the problem your log files would have an error that makes reference to a 32bit file, I can't remember the exact text.

hericles 289 Master Poster Featured Poster

I am indeed, how can I help you today?

hericles 289 Master Poster Featured Poster

And we desperately want to know what your problem is.
Don't mind the sarcasm, but seriously, you could include slightly more information with your post.

hericles 289 Master Poster Featured Poster

Create a table for the categories that holds the category name, its ID and its parent ID. Top level categories would have a parent ID of 0.
For example, your demo would look like:

ID, Name,    ParentID
1  Level1       0
2  Level1.1     1
3  Level1.2     1
4  Level1.2.a   3
5  Level1.2.b   3
6  Level1.2.b.a 5

You can now track all children of a level via the database and extend this to as many levels as you need.