The Way to Programming
The Way to Programming
What you need is a datatable, something like this should work: Might not be 100% accurate but should be close
Public Function GetProducts() As DataTable Dim query As String = "SELECT ProductID, ProductName, Type, Make, Description, Price, QtyOnHand FROM Products ORDER BY Price, Description" Dim dtaTable As New DataTable Dim dtaAdapter As New OleDb.OleDbDataAdapter(query, connection) dtaAdapter.Fill(dtaTable) Return dtaTable End Function Then call it using this code Dim ProductID$, ProductName$ Dim Products As DataTable = GetProducts() Dim ProductRow As DataRow ' Cycle thru Each Row in dataTable, like an Excel SpreadSheet For Each ProductRow In Products.Rows ProductID$ = ProductRow.Field("ProductID") ProductName$ = ProductRow.Field("ProductName") . . . . . 'Add Each Value to a List, Listview etc
Have you got this straighten out yet if not here is a small solution to your question:
Hello =$_SESSION['username'];?>, Welcome to this securecd area of my page
Here is other cool stuff you can do here
Logout - Yep you can do that too.“Login” usually means there’s a password (or rather, one-way-encoded password, like a hash) that get’s compared to user provided password (or rather, the userpass gets to be encoded using the same algorithm, and then compared).
So:
– HTML form sends data to the server
– PHP gets the data as POST
– you get the username and search if there is actually a user with that name,
– if not – error out with “no username or password wrong” – usually you don’t want to giveaway that the provided username is valid
– if so – you extract (from database?) some basic details, amongst that there’s encoded pass *
– you encode provided password using the same algorithm used at registration
– you compare the two and if their different you error out
– if pwd is valid, you set some session variables and show success page
on whatever other page you just start session and see if your session variables are set – if so, the user was logged in. Of course then you can add validation, maybe the user had different IP, browser/special cookie last request? If so, it’s possible (but not surely!) that it’s a session hijack taking place. But you can read about that on your own. Wink
*) this is actually usually the point were you either get some valid data back, or not, and you know if username is valid. I’ve split it to steps for clarity.
w3schools.com is a very good way to start. read EVERYTHING there. then you can use PHP or JSP (two very different technologies) to test out stuff and build web pages. If you choose JSPs, Google offers free hosting with Google AppEngine Smile
I haven’t seen one that does them all but they are available separately, python to exe, php to exe etc.
They are designed to run whatever script you ask it to not run as a server environment
For a full windows server environment then use something like easyphp or xampp but wont work as a standalone desktop app
since it is a java game, create a jar file instead of an exe. A jar file is able to run on any OS, i.e. linux, osx, provided that java virtual machine(JVM) is installed. If you still want exe, see the following link:
www.jar2exe.com/
If you want to create jar, view the following:
http://docs.oracle.com/javase/tutorial/deployment/jar/build.html
It is definitely possible to have the data from the text fields written plainly to some kind of text file as opposed to there being some kind of requirement to have them emailed to you…
What you’re asking for would require some programming or at least a basic understanding of PHP, however. Even if someone here was to specifically *write the code* that does this for you, and gave it to you, you’d still need to have some kind of online website to run it on, or at least your own private server to run the PHP component for you.
It’s difficult to tell what level you’re at but the general gist is that the information from the form you’ve posted will be sent to your web server where a PHP script will process it. You will code that PHP script to put that data *wherever you want* be that in an email, a text file, a database, whatever.
I have two data sources, and I want to create my own database which pulls data from both sources. Both data sources, get updated every day, so I must keep my own database up to date as well. How should I go about updating my own database? I was thinking of doing nightly updates. How do I go about this?
Here’s a solution…
$name) { switch($key) { case count($names)-2: $seperator = ' and '; break; case count($names)-1: $seperator = ''; break; default: $seperator = ', '; break; } echo $name.$seperator; }
I don’t know that book in particular, but I’ll reply anyway. In my opinion, there is no absolute best book to start learning. There are several good ones. There are even excellent sites that help you get started. Aiming for one book that has all the good treats with no flaws is a bit unrealistic.
If you’re considering buying the book, I’d google for the best book if I were you, just to get some useful book titles on your mind. However, what is good for another person might not be tailored for you.
Amazon reviews might or might not be useful/sincere. But the book descriptions always help you figure out at least the target public, the knowledge requirements and the topics covered by the book.
I believe buying a book nowadays isn’t absolutely essential to learn something like C++ programming. Tutorials, lessons and references are already scattered all over the Internet.
One more thing. If you’re just starting programming, many might consider C++ as a bad language to start with. Very, very complex! But it’s your choice
I suggest using PDO instead of the mysql_* functions, they are not being maintained anymore. PDO offers a FETCH constant to fetch a column – PDO::FETCH_COLUMN. That’s exactly the one you need. Visit the link provided by
If you don’t want to move to PDO, then this is the mysql_ function you need:
http://php.net/manual/en/function.mysql-result.php
switch (choice) { case 'C': System.out.print("Enter the radius of the circle: "); double radius = Double.parseDouble(scan.nextLine()); double area = Math.PI * radius * radius; System.out.println("Area of the circle is: " +Math.round(area)); break; case 'S': System.out.print("Enter the square's length: "); side = scan.nextInt (); double area = side * side; System.out.println("Area of the Square is: " +Math.round(area)); break; case 'R': System.out.print("Enter the rectangle's height: "); height = scan.nextInt (); System.out.print("Enter the rectangle's width: "); width = scan.nextInt (); double area = height * width; System.out.println("Area of square is: " +Math.round(area)); break; default: System.out.println("Incorrect value"); break; }
Make sure to change “String choice;” to “char choice”
The reason you use a ‘ ‘ instead of ” ” is simply because you check for chars. Checking for chars must be done with ‘ ‘.
If you want to keep it a String, change every ‘ in your switch to ”
Also: I saw in your code this: reader.readLine()
. I changed this to scan.nextLine()
simply because I prefer to work with Scanner. It’s your choice though, you can re-edit it if you like.
I personally learned CSS and JavaScript from this site:
http://www.codecademy.com
I figured out how to recurse through a folder, but to write to all files in the folder I can’t find out how to do that. If I put a wildcard like *.js or *.php it don’t work, I get a bad filename or number error, if I remove the wildcard and replace that with the actual name, it will work. Any other suggestions?
You can get eclipse from this website:
http://www.eclipse.org/downloads/
Just choose your OS. Then you have to download the android plugin for eclipse. This is how:
http://developer.android.com/sdk/installing/installing-adt.html
Then just write your app in Java, test, debug, over and over again and you’re done Smile (WARNING: This might be a tiny oversimplification of the process).
You can also download the whole bundle at once here:
http://developer.android.com/sdk/index.html
Sign in to your account