hericles 289 Master Poster Featured Poster

Right, I should have seen the code you linked in your first post, my bad. You have this line:
$dbh = new PDO('mysql:host=localhost:1433;dbname=ItemAssetDB', '', '');
which is, obviously, using PDO to connect to a mysql instance - which isn't what you're trying to do.
First step is to switch that line to:
mssql:host=localhost;dbname=testdb
and see what happens.

hericles 289 Master Poster Featured Poster

This is a bit confusing, you seem to be jumping from referring to MySql databases to SQL Server databases.
What db type are you trying to connect to, what is the exact error you are getting now and is it for all connections or when you are trying to a certain thing (like insert or date records)?

hericles 289 Master Poster Featured Poster

I'm not an expert in Mongo at all but have you tried it with double quotes around the text string instead of singles?
Single quotes can be an escape character in SQL and may be in mongo too, in which case the ) isn't being read as such.

hericles 289 Master Poster Featured Poster

And do you have the ability to access the site via FTP or similar?

hericles 289 Master Poster Featured Poster

Is the actual error "Error establishing a database connection"? And has the support guy been able to give you any further information from the server logs?

hericles 289 Master Poster Featured Poster

Given the easy nature of the string you can split on the '%' character and end up with an array of the text you are after.
The hard part is if the inputs aren't in the same order as the string or any kind of dynamic sorting is required. That's a fairly simple answer though, is that what you were after or did you have an tougher, more specific problem?

hericles 289 Master Poster Featured Poster

You haven't mentioned what language you intend to be using for this but the answer is yes, it's possible. Depending on what functions you have available in your chosen language you need to determine the location of the last \ and then create a substring from position 0 to the that last '\'.
A lot of languages have methods that will provide you with the file name, the thing.exe part of a path as well, which would allow to do a replace, swapping the file name with an empty string. Or alternatively return the path with the file name removed automatically.
If we knew what language you were using we could provide actual examples.

hericles 289 Master Poster Featured Poster

Is the PHP process started via AJAX? If it is, you can display a spinner gif when the AJAX call is first made (using jQuery or similar) and switch it off when the reponse comes back.
If the page starts the script and then redirects you can just have a spinner without worrying about the AJAX part.

hericles 289 Master Poster Featured Poster

I'm assuming the user's have their roles stored in the database and you extract them out when the user logs in successfully. Once you have that stored in the session (or wherever you keep it).
Then you have options. If the edit profile pages are quite different you can create the required templates and use a switch statement to recirect to the correct one based on the role.
Or, you can have one template with all of the controls needed, and when it is loaded only the relevant options for each role get displayed.
The same logic can work for adding links to menus, etc.

shany0786 commented: ah thnks this solved my problem +0
hericles 289 Master Poster Featured Poster

There is no difference. You would be creating an app that would display HTML, using whatever view in that language achieved that effect.
For example, a native iOS app that was just a view of a web site would use an UIWebView, in Android it would be a WebView and if you were building in Cordova/Phonegap you need to add the inAppBrowser plugin (which is simply Cordova's way of generating the two above for those platforms).

hericles 289 Master Poster Featured Poster

I think he was refering to an app that is nothing more than an in-app browser (a web view) that points to your website. Meaning the app wouldn't work without an internet connection (probably not an issue).

hericles 289 Master Poster Featured Poster

You only set the sql statement once but at line 17 you're using it as part of an IF statement:
If sql = "SELECT Usertype FROM [db_dole].[dbo].[tbl_user] WHERE Usertype = 'Admin'" Then
Which will never be true so that's part of the problem.

Otherwise you're on the right track. You just need to pull out the user's role from the database when they log in and adjust your form accordingly.
And, remember, every time you pass unfiltered text into an SQL query a little puppy dies.

ddanbe commented: Your last sentence! :) +15
Miurei commented: acctually I used almost the same code and got the result right... :) thanks anyway +0
hericles 289 Master Poster Featured Poster

echo "<select name='name' id='name' <?php if ($stat =='a'){ echo ('disabled');} ?> >";

I haven't actually tested that but the main point is you need the <?php ?> tags otherwise you're just going to echo out the if statement as text.

hericles 289 Master Poster Featured Poster

If you want it to be cross-platform on mobile you can look at using Cordova (Phonegap) or Xamarin. Both can be used via Visual Studio once you've installed some extras and you'll be able to build using your javascript knowledge. Any server side components can still be down in PHP if you wanted to, using whatever IDE you prefer.

hericles 289 Master Poster Featured Poster

You can loop through the numberList examining each number and its count. Take the first number as being the highest and store it in another variable e.g. int highestCount.
For each number in the list, compare it's count to highestCount. If it is higher, replace highestCount with the new count and store the number as well.
If a number has the same count as highestCount you'll want to keep it as well, dumping it only when highestCount is again replaced but another higher value.

hericles 289 Master Poster Featured Poster

You can use the 'required' html attribute by adding it to the necessary fields.
Or you can use a javascript function on the click event of the submit button to check all inputs and only if all pass validation does the function return true and let the submit continue.
Or you can still submit the form but use PHP code to check the passed parameters and either process the form or pass errors back to the page.

hericles 289 Master Poster Featured Poster

Your code looks OK, there is nothing that immediately stands out anyway.
So you need to tick off everything is working correctly.
Can you connect successfully to the database (does another query provide the correct results)?
Do the username/password variables hold actual values?
In your login function do both of the queries work and return values?
If you can't debug it at least dump out the variable values and the SQL statements so you confirm what is happening. Run the SQL into against the the database in the command line or similar to make sure that gives you what you would expect to see.

hericles 289 Master Poster Featured Poster

Alter your URL to be just the path with no parameters
<?php echo base_url('Register/get_countries')?>
As you have it, the post parameters don't include a parameter called 'q', only $_POST['queryParam'] should exist.
So, you can either edit the script to read the correct $_POST variable or take out the query from your URL and remove the default parameter name (the queryParam: q part)

hericles 289 Master Poster Featured Poster

I just started using the same library for a project too.
You haven't mentioned what the parameter matches in the database so I'll assume you want to check for a country name that equals the q parameter (not the correct case I know).
In this case you can do this:
$sql = 'SELECT country_name FROM nm_country where country = '" . $_GET["q"] . "';

hericles 289 Master Poster Featured Poster

PHP generated HTML arrives at the client's browser the same as any other server generated HTML - that is, it presents itself as nothing but HTML. There are <?php ?> tags in what is received. So the answer to your first question is yes, CSS and javascript can be used to target classes/IDs you generate in PHP because CSS and javascript can't tell the difference.
You may find it useful to get into the style followed by most open source PHP platforms where actual processing PHP (database operations/ calculations, etc) are done in a class while outputting PHP (making HTML) is in a template file. The separation will help kep things in order. Have a look at Smarty and similar templates to get an idea.

hericles 289 Master Poster Featured Poster

If I understand you correctly, by opting to start a course in a specific month means you know two things: age and birth month. From that you can get ??/mm/yyyy accurately but you'll never get the date. You simply need more information.

hericles 289 Master Poster Featured Poster

You say you're moving images to the database but is it the move_upload_file you are having trouble with?
If it is, that function returns a warning if something goes wrong so you can turn warnings on and see the problem. But you can also check the filename stored in $prodimg is valid and that your destination folder exists and is writable.

hericles 289 Master Poster Featured Poster

Because you've chosen to name the table in the FROM clause ('FROM student AS s'), you need to use that name in your selection part of the query
SELECT s.student_code...

hericles 289 Master Poster Featured Poster

Access denied means you need to look at your connection string. You're pointing to the wrong database, have the user name wrong or that user doesn't have access to that particular database. Something about your connection attempt is the cause of the error.

hericles 289 Master Poster Featured Poster

Sounds like a permissions issue.You don't have the rights to access the file. You can check this with the is_readable('/location/') function.

hericles 289 Master Poster Featured Poster

Might be time to post up the code for the page. Seeing a completely blank screen means you've got a fatal error in the PHP that causes it to basically crash.

hericles 289 Master Poster Featured Poster

Are using a web server in your setup?
You can't just rename an html file to have a php extension and have it work. PHP files are compiled by a web server (Apache, IIS, etc) and sent to the browser.
If you have an html ffile just lying around in a directory somewhere and rename to PHP nothing will happen, the page definitely won't present itself correctly in a browser.
If you haven't got an apache/WAMP set up running you'll need to look into that first. There try the CAPTHA thing again.

If you have further issues post up the code and have a look at the error logs from the server. They'll give you a hint as to what is going wrong.

hericles 289 Master Poster Featured Poster

DeviceType isn't showing the list of reserved words for SQL Server but it does seem to be a named enumeration in SQL Server 2012/14. You might want to use a different name for that table in case it is conflicting with SQL Server internal structure.

hericles 289 Master Poster Featured Poster

Remove the <pre> and out the result. It should be XML. Pre formatting is hiding that from you.

hericles 289 Master Poster Featured Poster

That query seems to be saying you only have 6 rows in the database with a value of 'van1'. I would have to say it is correct as the query is pretty straight forward. Have a close look at your data and see whats going on.
Is lower case an issue e.g. van vs Van?
There is no other data in the van column, trailing spaces, etc? You could test that with a LIKE against '%Van1%'

hericles 289 Master Poster Featured Poster

In PHP :: is used to denote a static class i.e. one that does not need the class to be instantiated first.
If the method is not static you need to instatiate the class and then access the method via $class->someMethod().

hericles 289 Master Poster Featured Poster

If it says the variable $wpdb is null then it's null.
I assume you are setting $wpdb somewhere else. You say you've defined it but have actually instantiated it?
You'd need to have a look at that code then as that is where your troulbe most likely lies.

hericles 289 Master Poster Featured Poster

The only thing I can see is that you're missing the final semi-colon (;) on the statement.
If it isn't that, can you provide the actual error message?

hericles 289 Master Poster Featured Poster

Can we have some extra detail please? Your post doesn't make sense.

hericles 289 Master Poster Featured Poster

If you intend to do it with .Net then you would need to post back the button click to the server side code. There you would instantiate a class variable or session variable that held the current count and on each postback when the button was clicked you would increment the variable by.
To display it you just pass the current count variable to whatever control you want to use to display the result, a listview in your case.

hericles 289 Master Poster Featured Poster

Very tricky question with, going by the US courts, a leaning toward it being a bad idea.
But, it all depends on what you are scraping (facts vs data), how you are scraping it (have accessed a private page) and how much harm you are doing to the affected party and how you intend to use.
Reselling the information or using it in some competitive way against the owner of the data would almost certainly get you in trouble.
Writing a screen scraper just to prove you can... no real harm in that. You can read the web page after all.
N.b. I'm have no legal background or qualifications, just so we're clear.

hericles 289 Master Poster Featured Poster

not being familar with bxSlider myself I would suggest looking at the console log in the browser to see if any javascript errors are being generated.

hericles 289 Master Poster Featured Poster

Then ask a colleague at ... <cough> NASA.

hericles 289 Master Poster Featured Poster

Do you know what browser they were using? I highly doubt it is the operating system that doesn't handle the javascript correctly. I'm going to guess they were using Safari.
You could have tried jQuery instead too. That would have saved doing every div manually as you have done as you could have used jQuery selectors for the same effect.

hericles 289 Master Poster Featured Poster

You use a dataAdapter to fill a dataTable (or a dataSet) with the result of the query.
In your case you would end up with a table with 4 rows, each one holding the state of one of the buttons.
You then do a foreach over the dataTable getting the relevant cell and checking its value.
I don't do too mcuh VB.Net stuff these days so this will be just pseudo code but it should help

Dim da as DataAdapter(command object goes here)
Dim dt as DataTable
// set command text for command object
da.Fill(dt)  // get your data
foreach(DataRow row as dt.Rows) 
    // locate cell that holds value you need and enable/disable button
hericles 289 Master Poster Featured Poster

Initialise the string sql to some value and the warning will go away.
Even this is fine:
string sql = null;
The compiler simply wants to know that not initialising the variable was a deliberate action rather than a mistake.

hericles 289 Master Poster Featured Poster

MailChimp or ConstantContact. I've used both and slightly prefer MailChimp. Both have good APIs available too.

hericles 289 Master Poster Featured Poster

A double loop should do the trick

For Each house as string in housing
    For Each person as string in people
        Dim s as string = house + "-" + person
    Next
Next

My VB.Net is a little rusty so my syntax maybe off but that should be the general idea.

hericles 289 Master Poster Featured Poster

you can either do multiple conditions in the WHERE statement:
WHERE id = x OR id = y etc
or you can use the in statement if you would rather pass in a group of values:
WHERE id in (x,y,z, etc)
and, of course, you could combine them if that works better:
WHERE id = x OR id in (a,b,c,d)

Obviously, the values from the datagrid would need to be passed in as parameters.

hericles 289 Master Poster Featured Poster

You could just rename or delete the favicon. Or do you not have access to it?

hericles 289 Master Poster Featured Poster

There's no specified way to do that (as far as I know). Any diagram that indicates the various components and where they sit in relation to each other should be fine.
Just google 'n tier diagram' and you'll find plenty of examples.

strRusty_gal commented: Thank You! +3
hericles 289 Master Poster Featured Poster

Both of those should work. Is your actual table different from this one? Because if you only have one row and one cell and no other styling how are you observing the width of the cell?

hericles 289 Master Poster Featured Poster

You could use AJAX and when the response comes back use jQuery to alter the CSS on the form and the message.
Unless you have some extra code somewhere, your method will display the thank you message regardless of how the submit process goes e.g. the code fails behind the scenes for whatever reason, the data isn't saved and the thank you message appears. User leaves happy thinking everything worked.

hericles 289 Master Poster Featured Poster

A 404 is fairly straightforward. I couldn't access that javascript file either but can reach others used by www.rovespier.com located in the same directory. I would conclude that jquery.dropdown.js doesn't exist.

hericles 289 Master Poster Featured Poster

What do you mean "won't play"? Is the site appearing without any styling?
I'm pretty sure chrome reads CSS and javascript locations correctly.