
waynew
Members-
Posts
2,405 -
Joined
-
Last visited
Everything posted by waynew
-
I hacked the site using notepad.
-
I have three columns. The first is the primary key id. The second two columns are what I'm interested in. [/td] 20 827233677 734812262 14 734812262 827233677 The example above shows "a match". Basically, what I'm looking for is to be able to select only the rows that have an opposite. i.e. row #20 has 827233677 in col_a and 734812262 in col_b. row #14 has 734812262 in col_a and 827233677 in col_b
-
Domain ideas for a social networking website?
waynew replied to TeddyKiller's topic in Miscellaneous
Rule #1: It has to be easy for others to spell. Pixodo could be Picsodo etc. -
There are tools out there that can do all of this for you, just so you know.
-
There's content copyright and design copyright.
-
To stop SQL injection I would advise you to use a function such as mysql_real_escape_string(). $username = mysql_real_escape_string($_POST['username']); $result = mysql_query("INSERT INTO user(username) VALUES('$username')") or trigger_error(mysql_error());
-
mysql - deleting records or marking them as deleted?
waynew replied to sw45acp's topic in Miscellaneous
If that "deleted" data (i.e active=0) could be useful later on, just mark it as inactive. If it's data that won't be useful later on, just delete it. -
It's the only version i'll use. Comes with XP, stays with XP. I'm not going to download a 300MB clone attempt of firefox and opera's tabs. No way. That's all good and well. Just don't get annoyed when you see that websites show like shit in it.
-
Thanks for the reply. I had to modify your SQL. The query I'm using is: $select = " SELECT * FROM friendship LEFT JOIN user AS u_1 ON friendship.user_a = u_1.user_id LEFT JOIN user AS u_2 ON friendship.user_b = u_2.user_id WHERE friendship.user_a = '".$user_id."' OR friendship.user_b = '".$user_id."'"; Your original one was scolding me about aliases and "user" not being unique. The above query is doing the reverse of what I want to do, which means I must be kind of close. Basically, it's looping out only the owner's name and not the name of his friend (I know for a fact that this owner only has one friend).
-
Thanks for the reply. My main goal is to show the user details of those who are friends with the person's profile I'm viewing. Also, is it nec. bad that I have friendship_id as the primary key? I have an index on both the user_a and user_b cols.
-
I've a query that I can't seem to get my head around. Basically, I have two tables: user friendship The table user holds all user related data. Its primary key is called user_id. My friendship table looks like this: Say for example, I visit somebody's profile. I'll get to see his or her friends. The problem is, his or her user_id could exist in either user_a OR user_b, hence the reason I'm having a problem in joining the friendship table with the user table.
-
I'm guessing that you're trying to make a quick buck via Amazon Affiliates? What I do recommend is that you focus on a geographical area with your keyword marketing. Nobody is going to Google for "Bubba".
-
Sarting My First Web Hosting Company What do you think of it?
waynew replied to Jnerocorp's topic in Website Critique
No such thing as unlimited. -
If you want help, I suggest that you act a little less sassy with the people who reply to your thread. If this credit card processing website expects you to store passwords etc in plain text, you need to find a different company to do business with. They most likely have further documentation. I suggest checking their site out or even contacting them/using their support forums.
-
HTML Tidy adds so many newlines though! You see, I usually use single quotes when generating HTML, so it would probably look like this for me. <?php while($row = mysql_fetch_assoc($result)){ echo '<img src="'.$row['img'].'" alt="Image" title="Image" />'."\n"; } ?>
-
You could use a HTML tidy program if you really needed to. I just think they look ugly.
-
I think it makes it look less readable. Maybe it's just me. I like my variables to stand out.
-
I never use heredoc. Usually, I do something like this: <?php //people using mysql_fetch_array when they obviously don't need it //also bugs the hell out of me while($row = mysql_fetch_assoc($result)){ include("html/newsitem.html.php"); } ?> Then in newsitem.html.php <tr> <td> <img src="<?php echo $row['img']; ?>" alt="<?php echo $row['colname']; ?>" /> </td> <td> <?php echo $row['colname']; ?> </td> </tr> I never add "\n" etc to my HTML. IMO it's not worth it.
-
$select = mysql_fetch_array(mysql_query("select * from user where username = '$_POST[username]' and password = '$_POST[pass]'")); echo $select[someKeyWithoutQuotesThatIsntAConstant]; You just made me rage.
-
People assuming that POST values exist. The use of addslashes for escaping dangerous characters. People not using exit(); after their redirects. I'll stop now.
-
I made one too. I had the help of specialised software:
-
<?php mysql_connect("localhost","root","") or die(mysql_error()); mysql_select_db("myDB"); $pass = addslashes($_POST['password']); $username = addslashes($_POST['username']); $select = mysql_fetch_array("select * from user where username = '$username' and password = '$pass'"); if(mysql_num_rows($select) > 0){ header('Location: cp.php'); } else { die('LOGIN INCORRECT PLEASE GO BACK'); } ?>
-
Dynamically Created Charts/Graphs, How And What?
waynew replied to phprocker's topic in PHP Coding Help
I use http://www.jgraph.com/