MmmVomit
Members-
Posts
319 -
Joined
-
Last visited
Never
Everything posted by MmmVomit
-
[SOLVED] variables have no values when echo'd
MmmVomit replied to thefollower's topic in PHP Coding Help
Both of those are perfectly valid. I use the former all the time. http://www.php.net/manual/en/language.types.array.php#language.types.array.donts -
Start getting rid of all the @ signs in front of the mysql functions and start adding "or die(mysql_error())" at the end of them.
-
You're missing a closing parenthesis at the end of the previous line. I do this all the time.
-
Are the dates the same? Different? Would you like the earliest date? Latest date?
-
I think you meant this. <?php $tmp = array(); while ($rw = mysql_fetch_assoc($rw)) $tmp[] = $rw['var']; echo impode('<br>,',$tmp); ?>
-
Yes, they exist.
-
Creating an automated for confirming orders in a shopping cart
MmmVomit replied to axiom007's topic in PHP Coding Help
You just have to figure out the proper WHERE clause for the sql query. Without knowing your specific database, no one here can help you. -
Essentially, that IS a join.
-
What does your table structure look like? What does your code currently look like?
-
Here's another good reference for SQL. http://www.w3schools.com/sql/default.asp
-
You want to add a Buddy table. It will look something like this. Buddy ---------------- ID UserID BuddyID 1 12 13 2 12 2 3 12 14 4 14 13 5 14 12 UserID points to the ID field in the User table, and BuddyID also points to the ID field in the User table. In the example I gave above it might be something like this User(12) requested User(13) as a buddy User(12) requested User(2) as a buddy User(12) requested User(14) as a buddy User(14) requested User(13) as a buddy User(14) confirmed User(12) as a buddy If that's your whole table, the only buddies in the database are users 12 and 14. You could simply have it that if someone requests a buddy, it's granted, so record 5 in the table is unnecessary and redundant, but that would probably be more complex. I suggest the previous method.
-
It sounds like what you want is another table. How exactly do you want buddies to work? Are all buddies also users?
-
Making a username and password without a database
MmmVomit replied to rondog's topic in PHP Coding Help
Are there going to be multiple users? -
Post your current code.
-
You missed the line of code I added. print_r($staff1);
-
[SOLVED] how to make my jobs easier n smooth?
MmmVomit replied to zgkhoo's topic in Application Design
Can you give a brief description of what you want your program to do? -
That field is probably a text field, so it's being sorted alphabetically. You need to change it to an integer field.
-
Separate it into several different scripts?
-
Hmm. I wonder if this would work. <?php $i = 0 foreach ($rss1->items as $item ) { $i++ $title = $item[title]; $url = $item[link]; echo "<a href=$url target='_blank'>$title</a></li><br> "; if($i >= 5) break; } ?> If the indexes are numerical, you can just use a regular for loop.
-
For debugging, try this. <?php $staff1 = $_REQUEST['staff1']; // also tried with $_GET and $_POST but neither worked for me print_r($staff1); if (isset($staff1)) { echo "hello"; } ?>
-
http://www.php.net/manual/en/language.oop.php It means that $params is an object or class, and get is a member function.
-
But you are setting the variable. You are doing it in the preceding line.
-
It actually wouldn't be in another script. This is something that is set through Apache. The values are set in the Apache config files, which have very limited access. If you're not using Apache, I'm sure other webservers can do something similar. Unfortunately, I don't know all the details off the top of my head, because I haven't actually done it myself, yet. I just know that it's possible, and would have to go look up the details. This is the book I learned this from.
-
That wouldn't be much better. People using the the webpage won't have any access to the PHP code. The vulnerability is that anyone who has access to the server's file system will be able to read the code and get the password. If the file is one directory higher it won't change who has access to the file. The way to solve this is put this info in a file readable by the web server and access the information through the $_SERVER variable.
-
No, the first method works just fine. Array indexes don't need to be quoted when included in a double quoted string. The first method won't generate any error message the second method wouldn't.