Follow us on Twitter!
You cannot teach a man anything; you can only help him find it within himself. - Galileo
Thursday, April 24, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 33
Guests Online: 28
Members Online: 5

Registered Members: 82901
Newest Member: sjs
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Page 1 of 2 1 2 >
Author

PHP/Mysql

yours31f
Member



Posts: 1678
Location: Dallas Texas
Joined: 27.04.07
Rank:
Elite
Posted on 04-09-08 16:57
So as some of you know, I am learning the both of them and, well, I am having a little trouble with it. I have no idea why this is harder to understand than a strict programming language. But well, I was going to see if anyone had any good sources to learn both from.

And by the way I will use this thread in the future if i have questions about the two of them.


Debugging is what programmers do to beta software to make it take up more room on your hard drive if it is running too efficiently.


img259.imageshack.us/img259/3713/sigr.png

yours31f@live.com yours31f@yahoo.com rpwd.info
Author

RE: PHP/Mysql


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 04-09-08 16:59
Did you look at w3schools , and tizag??

Also PHPFreaks, the forum and the tutorials


Author

RE: PHP/Mysql

spyware
Member



Posts: 4192
Location:
Joined: 14.04.07
Rank:
God
Warn Level: 90
Posted on 04-09-08 17:01
If you can learn C++ and you can't learn PHP, you could not have learned C++.



img507.imageshack.us/img507/3580/spynewsig3il1.png
"The chowner of property." - Zeph
[small]
Widespread intellectual and moral docility may be convenient for leaders in the short term,
but it is suicidal for nations in the long term.
- Carl Sagan
[center]�Since the grid is inescapable, what were the earlier lasers about? Does the corridor have a sense of humor?� - Ebert[/ce
Author

RE: PHP/Mysql


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 04-09-08 17:22
yours31f wrote:
I have no idea why this is harder to understand than a strict programming language.


By "strict programming language", I'm assuming you are referring to the typeless variables in PHP. Everything else is similar to a "typed" language like C++. PHP is a scripting language, and should be thought of as such... there is the capability to use OOP structures in PHP, but the majority of its use falls under procedural style programming. Thus, use PHP in the same layout as you would HTML, almost as a replacement or optimization for HTML content. That's all it does, anyways... it creates HTML content using functionality that HTML does not have (since HTML is not a programming language but, rather, a language construct).

MySQL is not hard... you can break it down into function, table argument, search criteria, order criteria, and sort criteria. Take a couple of example MySQL queries:

Code
"SHOW TABLES"



SHOW is the function, TABLES is the argument. This will list tables. "SHOW DATABASES" will list databases.

Code
"SELECT id,name FROM categories ORDER BY id DESC"



SELECT and FROM are the functions, "id,name" and "categories" are the table arguments (table columns) for each (respectively), ORDER BY is the order function, "id" is the order criteria, and DESC is the sort criteria (there is no function for sort criteria as they are added to the order function).

Code
"INSERT INTO categories VALUES(NULL,'test name')"



INSERT INTO and VALUES are the functions (VALUES functions as a language-defined array construct), categories is the table argument for INSERT INTO, and NULL,'test name' are the table arguments (array elements, for sake of making it simpler) for VALUES.


That's it for simple MySQL query structure. Learn in this order:

1. SELECT, INSERT, UPDATE, and DELETE functions and table arguments
2. Search criteria, order criteria, and sort criteria
3. CREATE, ALTER, DROP, and SHOW functions
4. MySQL Joins in a Query

You're just waiting for someone to feed you, and no one either wants to or has the time to... not when we have our own learning to do.




Edited by on 04-09-08 17:48
Author

RE: PHP/Mysql


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 04-09-08 17:24
yours31f wrote:
So as some of you know, I am learning the both of them and, well, I am having a little trouble with it. I have no idea why this is harder to understand than a strict programming language. But well, I was going to see if anyone had any good sources to learn both from.


There's really no good reason to try and learn both at the same time. Any time you start with something it's a little tough, but PHP probably wouldn't be hard if you were dealing with it standalone. These just happen to be the two languages I have gotten into, the reason I'm posting.

In summer of 2005 I started to learn C++. Stumbling around with a new compiler, even the hello world was daunting. I continued to read and experiment though, something a lot of people just don't do around here. Please, look around the whole internet, no one says you have to learn from a single site. There are sites out there that give prototypes of library functions, along with examples how to use them. Yea, the type system will seem extreme, but you it will grow on you.


Author

RE: PHP/Mysql

yours31f
Member



Posts: 1678
Location: Dallas Texas
Joined: 27.04.07
Rank:
Elite
Posted on 04-09-08 17:38
Ok the past post (except spyware's, but he's always welcome to post in my threads) were helpful. I understand that both don't have to be learned at the same time but i tend to procrastinate or just never get around to finish learning things, But this site has helped me with that so much since i have joined.


Debugging is what programmers do to beta software to make it take up more room on your hard drive if it is running too efficiently.


img259.imageshack.us/img259/3713/sigr.png

yours31f@live.com yours31f@yahoo.com rpwd.info
Author

RE: PHP/Mysql

yours31f
Member



Posts: 1678
Location: Dallas Texas
Joined: 27.04.07
Rank:
Elite
Posted on 04-09-08 22:13
Ok so I get an error but I cant fond whats wrong with this code...

here is the error
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<?php
$con = mysql_connect("mysql","name","password"Wink' at line 1
obviously its line one but whats wrong with it?


<?php
$con = mysql_connect("mysql","Name","Password"Wink;
if (!$con)
{
die('Could not connect: ' . mysql_error());
}

if (mysql_query("CREATE DATABASE Table",$con))
{
echo "Database created";
}
else
{
echo "Error creating database: " . mysql_error();
}

// Create table in login database
mysql_select_db("table", $con);
$sql = "CREATE TABLE *****
(
username varchar(15),
password varchar(15)
)";

mysql_query("INSERT INTO user (username, password)
VALUES ('*********', '**********'Wink"Wink;
mysql_query($sql,$con);
mysql_close($con);

?>


Debugging is what programmers do to beta software to make it take up more room on your hard drive if it is running too efficiently.


img259.imageshack.us/img259/3713/sigr.png

yours31f@live.com yours31f@yahoo.com rpwd.info
Author

RE: PHP/Mysql


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 04-09-08 22:19
should be

$con = mysql_connect("mysql","Name","Password");

You had an extra ; after password
$con = mysql_connect("mysql","Name","Password";);


Author

RE: PHP/Mysql

yours31f
Member



Posts: 1678
Location: Dallas Texas
Joined: 27.04.07
Rank:
Elite
Posted on 04-09-08 22:22
ty


Debugging is what programmers do to beta software to make it take up more room on your hard drive if it is running too efficiently.


img259.imageshack.us/img259/3713/sigr.png

yours31f@live.com yours31f@yahoo.com rpwd.info
Author

RE: PHP/Mysql

spyware
Member



Posts: 4192
Location:
Joined: 14.04.07
Rank:
God
Warn Level: 90
Posted on 04-09-08 22:23
Error messages: for those who are willing to learn.

Now beat it.

Just, beat it.



img507.imageshack.us/img507/3580/spynewsig3il1.png
"The chowner of property." - Zeph
[small]
Widespread intellectual and moral docility may be convenient for leaders in the short term,
but it is suicidal for nations in the long term.
- Carl Sagan
[center]�Since the grid is inescapable, what were the earlier lasers about? Does the corridor have a sense of humor?� - Ebert[/ce
Author

RE: PHP/Mysql


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 04-09-08 22:43
The only time you need a semi-colon is at the end of a line of code. I feel like I've said this before...


Author

RE: PHP/Mysql

hellboundhackersok
Member



Posts: 353
Location:
Joined: 20.09.07
Rank:
Moderate
Warn Level: 95
Posted on 05-09-08 02:48
Fuck man... google has everything you'll need.


i.imgur.com/qBWHo0R.png
Author

RE: PHP/Mysql

yours31f
Member



Posts: 1678
Location: Dallas Texas
Joined: 27.04.07
Rank:
Elite
Posted on 05-09-08 02:54
I rather enjoy talking to people, google just isnt social enough,

Now maybe if google and facebook/myspace got together, they could become as <sarcasm>good</sarcasm> as microsoft.


Debugging is what programmers do to beta software to make it take up more room on your hard drive if it is running too efficiently.


img259.imageshack.us/img259/3713/sigr.png

yours31f@live.com yours31f@yahoo.com rpwd.info
Author

RE: PHP/Mysql


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 05-09-08 03:21
hellboundhackersok wrote:
Fuck man... google has everything you'll need.


Wow... it's been about 2 years, and you're still a noob. You should probably work on that if you expect anyone to take you seriously.

yours31f wrote:
I rather enjoy talking to people, google just isnt social enough,


Well, people aren't going to keep catering to your questions. So, either you start trying to learn on your own, or people are just going to shit on your threads. Either way, you need to use other resources than the threads on this site.




Edited by on 05-09-08 03:24
Author

RE: PHP/Mysql

yours31f
Member



Posts: 1678
Location: Dallas Texas
Joined: 27.04.07
Rank:
Elite
Posted on 05-09-08 03:38
I agree and I will.


Debugging is what programmers do to beta software to make it take up more room on your hard drive if it is running too efficiently.


img259.imageshack.us/img259/3713/sigr.png

yours31f@live.com yours31f@yahoo.com rpwd.info
Author

RE: PHP/Mysql

yours31f
Member



Posts: 1678
Location: Dallas Texas
Joined: 27.04.07
Rank:
Elite
Posted on 05-09-08 03:49
Ok Now I have a serious question. I made a login form, then made it post to login.php, so my question is (yes i have searched and cannot find a way to make it work.) How do I make the script do this?

test to see

if ($post["username"] == * from column username)
{
&&

if ($post["password']== * from column password)
{
setcookie(user,$post["username"],3600,mysite.com);
}
}
else {
echo "incorrect login info";
}
?>


Debugging is what programmers do to beta software to make it take up more room on your hard drive if it is running too efficiently.


img259.imageshack.us/img259/3713/sigr.png

yours31f@live.com yours31f@yahoo.com rpwd.info
Author

RE: PHP/Mysql

yours31f
Member



Posts: 1678
Location: Dallas Texas
Joined: 27.04.07
Rank:
Elite
Posted on 05-09-08 12:54
still need help with this one...^^


Debugging is what programmers do to beta software to make it take up more room on your hard drive if it is running too efficiently.


img259.imageshack.us/img259/3713/sigr.png

yours31f@live.com yours31f@yahoo.com rpwd.info
Author

RE: PHP/Mysql


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 05-09-08 13:13
yours31f wrote:
How do I make the script do this?

test to see

if ($post["username"] == * from column username)
&&
if ($post["password']== * from column password)


Do you even attempt to learn anything on your own? What is the point of a MySQL SELECT statement? For the form bit, just Google "php post form". I'm tired of answering your crap when you don't even try on your own.


Author

RE: PHP/Mysql


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 05-09-08 13:15
Ok, first off in the form action put , login.php , then on the submit button give it a name , call it submit for now , then on login .php

This is how you will check if posted

if(isset($_POST['submit']))
{
//form is posted, do what u must.



}


Author

RE: PHP/Mysql

yours31f
Member



Posts: 1678
Location: Dallas Texas
Joined: 27.04.07
Rank:
Elite
Posted on 05-09-08 15:01
I have that but i need to check if the form data == database data.


Debugging is what programmers do to beta software to make it take up more room on your hard drive if it is running too efficiently.


img259.imageshack.us/img259/3713/sigr.png

yours31f@live.com yours31f@yahoo.com rpwd.info
Page 1 of 2 1 2 >