Maq
Administrators-
Posts
9,363 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Maq
-
XML is an excellent way to transfer information. For example an e-commerce site may get products, updates, etc. for their store to update. XML is an easy universal way to transfer this information. They just give you the format and you parse it to your preference. Another example is AJAX. Without refreshing the page you can get server side data and display it client side.
-
Work in progress eh? Instead of all those escaping back slashes you can use single quotes. Anyway for this input field you would do:
-
Can you post your form?
-
[SOLVED] Whats better for servers, Microsoft or Linux?
Maq replied to Dogboys's topic in Miscellaneous
Yes it has, and I'm sure you can find plenty of satisfying article/discussions/comparisons etc. over this. For example... -
1) Concatenation. $final_date = "" . $_POST[dd] . "/" . $_POST[mm] . "/" . $_POST[yyyy] . ""; 2) Yes. You can do this using Javascript. onfocus="this.value = ( this.value == this.defaultValue ) ? '' : this.value;return true;">
-
Is your friend's site being hosted on a different server? I think you have to configure mail.
-
$query = "SELECT VotedFor, Count(UserID) FROM your_table GROUP BY VotedFor"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ echo "User ". $row['COUNT(UserID)'] ." : Total Votes: ". $row['VotedFor'] ." "; } A userid with > 0 votes? : $query = "SELECT VotedFor, Count(UserID) FROM your_table GROUP BY VotedFor"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ if($row['COUNT(UserID)'] > 0) { echo "User ". $row['VotedFor'] ." : Total Votes: ". $row['COUNT(UserID)'] ." "; } }
-
Yeah, I don't know why I posted my first solution, very inefficient. Barand's right... Should be: $result = mysql_query("SELECT * FROM artist WHERE lastname LIKE 'A%'");
-
Yes JS is your best choice. I'd go with the basic progress bar.
-
Just follow the tutorial and replace the image names with however you dynamically take them out of your database with PHP. Make sense? This is almost all JS just a bit of PHP to dynamically change the image names unless you want to hard code them in.....
-
Then why did you ask?! J/k.
-
echo "".$row['userlevel'].""; Here's something more readable.
-
Why not use JS or flash? Do you have to use PHP or something?
-
Have you fixed the LIKE clause? I can't test right now so I'm not sure if it will work.
-
$query = "SELECT userlevel FROM user_levels ORDER BY userlevel_id"; For an optimized query you should really only SELECT the fields you need like above, not *.
-
echo "";
-
This is straight up a poor design in the first place. You would be much better off normalising your data. At least he lives up to his name... -You have a space in your variable... Did you mean $the_number? -You're doing the like wrong. LIKE '%$the_number%' ");
-
It can't! What a weak language...
-
Is this something you want someone else to do? Or you want to do with someone else? This really doesn't belong in the application design section. Cool idea though
-
$sel_subject['visible'] doesn't even have a value to begin with. So in this piece of code: if ($sel_subject['visible'] == 0) { echo " checked"; } ?> /> No if ($sel_subject['visible'] == 1) { echo " checked"; } ?> /> Yes You're comparing nothing to 1 and 0.
-
if(strtoupper(substr($last_name, 0, 1)) == 'A') { //found a match } else { //do something else } "Aa" does start with A...
-
Is this what you mean... include("lib.php"); $player = check_user($secret_key, $db); if($player->money city_id == 2) { header("location: home.php"); } else { $query = $db->execute("update `players` set `money`=?, `city_id`=2 where `id`=?", array($player->money - 1000, $player->id )); } ?>
-
while($var1 > 0 && $var2 > 0) {
-
Arrays, where?
-
Ok, that's your choice... It's always good to cleanse the value anyway because if you decide to change the way that it is inputted or copy this code for something else, etc... you may have a problem. Anyway, your problem lays here; The single quotes from the post get confused with the single quotes surrounding the actual value. You don't even need those single quotes because you're comparing integers. A good way to debug this situation is echo out $sql2 to see the actual query statement that is taking place.