hericles 289 Master Poster Featured Poster

No, they are not the same.
Formats like CSV or .txt are just data. They have no ability to store meta-information at all.
.xls and .doc, etc have the ability to store and display style rules. You can export to a speadsheet file for sure, in higher level languages like .Net and java. I doubt you'll be able to do that in javascript, I would expect it to require a post to the server, but I may be wrong.

Even if you could save the data to .xls, adding in the HTMl colours would be a bit of work due to how .xls files are written.

hericles 289 Master Poster Featured Poster

Limiting the results to just links containing "media.tumblr.com" is easy:
if(strpos($element->href, 'media.tumblr.com') !== false) {
echo $element->href . '<br>';'}'
will remove any that don't include that string

For the next pages, put a for loop around your scrapping code and add the loop iteration onto the URL each time

hericles 289 Master Poster Featured Poster

You haven't explained exactly what this bill number is but, assuming you've got your table starting at 1 for the first entry, if the returned rows is zero (no records in the table) you know your first bill number is 1. Other increment by 1 as you are doing.

Dim BillNo As New DataTable
BillNo = New DAL().selectdatatable(" Select * FROM client ")
If (BillNo.Rows.Count < 1) 
    txtBillNo.Text = "1" // or whatever is relevant
Else
    For i As Integer = 0 To BillNo.Rows.Count
        txtBillNo.Text = BillNo.Rows(i)(0).ToString + 1
    Next
End IF

My VB syntax is rusty so my If loop maybe incorrect.

Santanu.Das commented: Loop should be [ For i As Integer = 0 To (BillNo.Rows.Count-1) ] +7
hericles 289 Master Poster Featured Poster

Your function gets called every time there is a scroll event, so at the bottom of the page, with no more pictures to display, it has no choice to respond with "There are no pictures."
Add a variable and set it to true when you reach the "no pictures point". Then check if that variable is false at the start of the scroll event before proceeding.
Can't help with the IE thing...

hericles 289 Master Poster Featured Poster

You need to quote the id in the jquery call
jQuery('#details-modal').modal('hide');
They are strings not variables.

sahilmohile15 commented: Thanks the code is solved and working fine. +0
hericles 289 Master Poster Featured Poster

It is an error.
var data {"id": id};
isn't valid javascript.
var data = {"id": id};

sahilmohile15 commented: Thanks +0
hericles 289 Master Poster Featured Poster

First thing to check is whether your javascript function is appearing on the page.
Once the page is loaded in the browser, view the source and confirm the footer is loading correctly and that the detailsmodal function is part of the page source.

Are you getting any other errors from the page in the console?

hericles 289 Master Poster Featured Poster

Firstly, it looks like you need to use double quotes as you're including a variable in the file name name string.
file_put_contents("files/$file");
Single quotes are 'dumb' and don't parse variables to strings.

Secondly, file_put_contents uses a second parameter which is the data to put in the file.
file_put_contents("files/$file", $someData);
Without that it doesn't do anything (apart from logging an error).

hericles 289 Master Poster Featured Poster

Seeing as you're inserting or updating one row at a time simply include to variables, one for updated, one for inserted, and increment each other the respective database operation.
Once, you're done you have your two totals.
If the update could affect more than one row in the database, the update command returns the number of rows affected so catch the return in a variable.

hericles 289 Master Poster Featured Poster

So you don't want a static page at all. You want a template page that pulls through the data for the correct restaurant and displays it and styles the page.
You need a basic HTML layout in the format you like, a database that can hold the information for each restaurant and code that detects which restaurant is being requested (presumably from the URL), pulls it from the database and loads into the template.
You want something like Wordpress.

hericles 289 Master Poster Featured Poster

There isn't a special case with fingerprint templates at all. As @ryantroop tried to explain you're trying to compare two images as exactly the same when they won't be.
This is a brief explanation of finger print scanning taken from the net:
"When a computer checks your fingerprints, there obviously isn't a little person with a magnifying glass sitting inside, comparing your fingerprints with all the hundreds or thousands stored in the database! So how can a computer compare prints? During enrollment or verification, each print is analyzed for very specific features called minutiae, where the lines in your fingerprint terminate or split in two. The computer measures the distances and angles between these features—a bit like drawing lines between them—and then uses an algorithm (mathematical process) to turn this information into a unique numeric code. Comparing fingerprints is then simply a matter of comparing their unique codes. If the codes match, the prints match, and the person gains access."

Taking an image of a finger print and hoping to get an exact match with a second image of the same finger print when they're both converted to bytes is hopelessly simplistic. Even the smallest change will cause the select to fail.
You need a better process for recording the fingerprints, like the one above.

hericles 289 Master Poster Featured Poster

Limit 2 won't skip the first two IDs. It will mean the query only returns 2 rows.
You do a subquery, selecting all IDs in ascending order limit 2 and then use the NOT IN selector to return the rest of the rows.
Depending on the size of your table that could have a performance affect though.
I've assumed client_id is the id you are referring to

select group_concat(id) as ids from private_tuition_teacher_pdf 
where 
client_id NOT IN (select client_id from private_tuition_teacher_pdf order by client id asc limit 2)
and client_id = 14 and teacher_id = 15 
order by id desc
limit 2 
hericles 289 Master Poster Featured Poster

Learning to code takes practise, you won't learn just by reading a book.
Find a book that is for beginners e.g. https://it-ebooks.info/book/4941/ and work along. Download an IDE like netBeans or eclipse and try some very basic examples and work from there.
You'll want to start off with either a book or online tutorial that explains writing the code, how to compile and then execute your project.
Once you can write a simple project that runs without errors you can look into different data structures and basic methods, adding them into your basic project.
Just take little steps for a while and you'll start to get a grasp of it.

hericles 289 Master Poster Featured Poster

In other words you have had an idea but don't know how to implement it?
You say you have a problem with the logic but you don't even tell us what that is. How are we to help you wth that?

hericles 289 Master Poster Featured Poster

If you wanrt to go cross-platform you would probably want cordova or xamarin. These let you build one app that builds for iOS, android and windows phone (with restrictions if you're doing something really cutting edge).
If you wanted to target just android or iOS I'd still consider using one of the cross platform options.
I find cordova much easier to work with than Apple's XCode and Objective C.

Should you use internal storage? Depends on what your app does. I would imagine you'd at least want to use internal storage if not an on-device database (sqlite or similar).

hericles 289 Master Poster Featured Poster

We'd need a lot more information to help you. Are you using a platform (wordpress, Joomla, etc) or is this a custom coded project?
Are you using a shared hosting environment? You haven't even given us the URL.

hericles 289 Master Poster Featured Poster

If the username is unique (which it should be) you can do a SELECT first with the username as the parameter. If the result contains a row the user already exists, if it's empty then the user is not already in the table.
You could also execute the insert if the username column is set to be unique and if the insert fails you know it probably failed because the users exists. But the first way is better.

hericles 289 Master Poster Featured Poster

Key is a reserved word in MySQL. You need to use back ticks to escape it rather than quotes.
Backticks are the key to the left of the 1 on most keyboards, with the tilde character: ~ as the shift option.

hericles 289 Master Poster Featured Poster

You create a range of variables:
double fed_tax = 0, state_tax = 0, hrswrk, payrate=0, gross_salary = 0; double hrlyrate=0;
But never change their values. For example, you get the user to enter a value for hrswrk but then times that by hrlyrate.

0 x anything = 0. All of the other calculations are similarly zeros get added and multipled together.

hericles 289 Master Poster Featured Poster

How much do you know about facial recognition software and algorithms needed to accurately detect parts of the face?
To be honest this isn't an easy project and without skills in the correct, and reasonably advanced, fields you're going to struggle.

hericles 289 Master Poster Featured Poster

Do you mean something like the Regex.Match() method? You intend to search a string for a pattern correct?

rproffitt commented: Was looking into that. Yes, that's it. +7
hericles 289 Master Poster Featured Poster

What search terms are you targeting? If you're trying to compete on terms like 'web design' you've got long road ahead of you...
Having just checked your meta tags it appears you are. If you're trying for local business only you can add 'India' or your city after each term as that is what local customers will search for.
I ran an SEO tool against your site and you scored 61.
The main problems were uncompressed js and css and a large amount of uncompressed HTML, all adding to a slow load time - which affects how google views your site. It also got flagged for no social media activity.

hericles 289 Master Poster Featured Poster

It's missing a closing }, ad another one at line 22 (making the ?> on line 23).
Is the code in the comment above in the exact same format as in your IDE? I'm refering to where each line starts in relation to the others here.
If it is you would benefit greatly from correctly indenting your code. Mistakes like missing } show up much easier.
If that was just the result of pasting it into the editor here then ignore that last part :)

hericles 289 Master Poster Featured Poster

Your signatures for the userExit method don't match. You're calling it with no parameters but the method signature expects a variable called empCode.

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

You'll have to double check each x item in your list. One of them doesn't have a value for the name property. The null pointer exception really only means one thing: the value it refers to is null.
Step through the loop in the debugger, wait for it to error and go back a couple of lines, check which item in the loop you're up to and confirm it's values.

hericles 289 Master Poster Featured Poster

The PHP manual has this to say about the mysql_select_db method's second parameter (called the link identifier):
Link Identifer:
The MySQL connection. If the link identifier is not specified, the last link opened by mysql_connect() is assumed. If no such link is found, it will try to create one as if mysql_connect() was called with no arguments. If no connection is found or established, an E_WARNING level error is generated.
It loks more, like you have your parameters in incorrect order in that line, In the previous musql_select_db you have a string and then the connection.
And kulcsarb has a point, you refer to $this->cnx and $this->cnxSP. That's not a typo?

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

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

Move your code into the click or change event of the checkbox.
You'll want to refer to the parent of the checkbox to make sure you are targeting the correct td.

$("td input['type=checkbox']").change(function() {
     if($(this).prop('checked')) {
         $(this).parent().css('background-color', '#somecolour');
     }
});

that should work, I haven't tested it myself but at the least, it points you in the right direction.

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

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 load up what is called a CSS reset file first, this is just a standard CSS file but it resets a lot of display properties to default. You then apply your site's CSS and you should achieve a level of consistency across browsers.
You don't have to write a reset file yourself, google css reset and you'll find ones ready to download.
That may not fix all of your problems however - if you have specific issues after using the reset file you can post them up.

hericles 289 Master Poster Featured Poster

If your code example here is the same as your actual code you have several problems.
Line 17:
echo "<table>";
Line 18:
echo "<tr><th>Airport</th><th>City</th><th>Code</th></tr>";
Line 21: your inner arrays only have 3 items so you don't need to loop to 10
for ($col = 0; $col < 10; $col++) {
And, lastly, you don't have a closing </tr> inside you col loop, which is probably making your table present itself in a way you don't intend.

hericles 289 Master Poster Featured Poster

I'd suggest learning coding first if you need to pick one. Give yourself an understanding of how to code and do some small projects, etc. Then when you come to learn algorithms you'll be able to see how your code could be improved. Your previous mistakes and in-efficient code will help the new stuff make sense.

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

Cordova/Phonegap. I've built a couple of apps this year using Cordova and maintained a couple of others. It's a pretty easy learning curve, heaps of plugins and dev tools to help you - I do my cordova programming in visual studio 2015.
The down side of cross platform, if you're oding it yourself, is that at some point you still need a mac to build the iOS version (if you work on Linux or windows).

hericles 289 Master Poster Featured Poster

Most systems would create the menu by checking which elements should show. Typically that would entail checking if the user was logged in or not and displaing the log in/register stuff if the they weren't.
So, you wouldn't need to create a whole new menu, you just use the checks to determine which <li> elements get created.
But, essentially, you're on the right track.

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

Alert boxes can't be customised too much. I would suggest looking into some of the javascript libaries that do that for you. SweetAlert is one I've used but there are others. You can vary the text and add images into the message.

hericles 289 Master Poster Featured Poster

Look into the jQuery .change() method. You can attach it to a select element with something like this:

$( "#myselect" ).change(function() {
  // your code to run on a change event
  // in your case, getting the 'cover' element and changing its src
});
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

Where the interviewers referring to natural keys? Or composite keys? Thats a unclear question.
If you don't know already, a natural key is a column in a table that uniquely identified the records but is part of the natural data, say, a social security number or employee number, something that dircetly relates to the row in the way that a primary key doesn't but is still distinct among the records.
A composite key is a key made up of several fields from the table, the result of which is a unique key e.g. someone's phone and email combined.
Or they could have been after GUIDs...?
Hope that helps.

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

Are each of your search values (brand, model and paper) actual values?
If they are empty values then they will return everything as
LIKE '%$brand%' is equivalent to LIKE '%%' if $brand is an empty value, which matches all values in that column.

hericles 289 Master Poster Featured Poster

The other day I came across
"I came into the world kicking, screaming and covered in somebody else's blood. I have no problem going out the same way."
Not your usual 'Be all you can be' quote but I still like it.

diafol commented: brilliant +0
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

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

Its a little more advanced than your example but you could screen scrape your website page and get the value of the textbox that way and then check it against your project textbox.
But you won't find anything as simple as
if me.textbox1.text=www.mywebsite.com.textbox1.text then

OMER AHMED commented: nice but need more details please +2