ignace
Moderators-
Posts
6,457 -
Joined
-
Last visited
-
Days Won
26
Everything posted by ignace
-
if ($result = mysql_query($sql)) { This makes sure the query succeeded. Your query on the other hand is wrong and so is: $staName = $row['staStations.stationName']; Which should be simply: $staName = $row['stationName'];
-
Add a new field to your users table like: last_click_at DATETIME Then using the below query you can find which users are currently online (clicked in the last 5 minutes) SELECT * FROM users WHERE last_click_at BETWEEN now() - 300 AND now() Ofcourse this implies that you update this field on every click.
-
Echo "<tr><td align='center'><a href=\"http://www.mywebsite/images/".$row['photo1'] ."\" rel=\"lightbox[mando]\" id=\"image1\" title=\"image 1\"><img src=\"http://www.mywebsite/images/".$row['photo1'] ."\" alt='photo1' border='1' height='160' width='171' /></a></td><tr>";
-
Woops sorry misunderstood your question.
-
I've created 2 php file but getting mysql_fetch_array() error
ignace replied to egturnkey's topic in PHP Coding Help
if ($productresult = mysql_query($productSQL)) { $productrow = mysql_fetch_array($productresult); } -
Echo "<tr><td align='center'><a href=".$row['photo1'] ." rel=\"lightbox[mando]\" id=\"image1\" title=\"image 1\"><img src=http://www.mywebsite/images/".$row['photo1'] ." alt='photo1' border='1' height='160' width='171' /></a></td><tr>";
-
I've created 2 php file but getting mysql_fetch_array() error
ignace replied to egturnkey's topic in PHP Coding Help
$productresult = mysql_query($productSQL) or trigger_error('Error: ' . mysql_error()); $productrow = mysql_fetch_array($productresult); -
By that he means: $number & 0x000000FF Just in case you wouldn't know what he means with "and it"
-
You are missing the xml document definition: <?xml version='1.0'?>
-
My original question then still applies. What if you again have multiple songs, lyrics, artwork are you going to keep them in that single file (even if it gets over 100 megs)?
-
Is it possible to change the value-separator? Thus instead of , use ;? Otherwise you could use: $values = array(); preg_match('/\d+|"[A-Z-,-\.-0-9]+"/', $csvline, $values); print_r($values);
-
[SOLVED] Can anybody explain why php behaves inconsistently?
ignace replied to litarena's topic in PHP Coding Help
Damn I need to get my eyes checked I didn't even see that at first. Upgrade server a to the version of server b and you are good to go. The reason your script on a is failing is due to the php version installed 4.0.6 $_SERVER as in $_SERVER['PHP_SELF'] was only introduced as of 4.1.0 pointed out by pfmabismad. -
[SOLVED] Can anybody explain why php behaves inconsistently?
ignace replied to litarena's topic in PHP Coding Help
Have you tried outputting what $_POST contains on both servers after submitting the form? -
http://dev.mysql.com/doc/refman/5.0/en/charset-binary-op.html
-
I don't entirely understand what you mean. Do you mean the user enters: A Name 11 The Road The Town The City In the textarea? But also could enter: A Name 11 The Road The Town The City
-
while ($rs_skill = mysql_fetch_array($result_skill)) { echo $rs_skill['id'], ' in ', print_r($_POST['skill'], true), '<br>'; print "<option value=\"".$rs_skill["id"]."\"".(isset($_POST['skill']) && in_array($rs_skill['id'], $_POST['skill']) ? ' selected="selected"' : '').">".ucwords($rs_skill["skill"])."</option>"; } What does this give you?
-
Yes because if you would have a second mp3 file then how would you know which a user has already downloaded? INSERT INTO records VALUES (email, used) You could ofcourse expand it with: INSERT INTO records VALUES (email, mp3, used) But IMO it would be better if you had something like: CREATE TABLE users ( #table definition ); CREATE TABLE songs ( #table definition ); CREATE TABLE users_downloads ( users_downloads_users_id INTEGER NOT NULL, users_downloads_songs_id INTEGER NOT NULL, PRIMARY KEY (users_downloads_users_id, users_downloads_songs_id) ); If a record exists for the users_id with the given songs_id in the users_downloads table then the user has already downloaded that song. This has a great advantage over: INSERT INTO records VALUES (email, mp3, used) Because the user's details are contained within the users table and the songs details are contained in the songs table thus making it possible to update either without having to worry the user might be able to download a song two times as would happen with the previous method (records table) when you update a song's name.
-
case 'fight_view1': $fight = 'fight1'; include('fight_view.php'); break; In fight_view.php $fight = isset($fight) ? $fight : $_GET['fight'];
-
With an attitude like that no sorry can't help ya.
-
lol that makes perfect sence.. ^^ Yeah it does. You create joins because of created relationships if you lower the number of relationships then so do your number of joins. If you don't know what denormalisation is then look up what db normalisation is (denormalisation is the reverse process).
-
denormalise parts of your db
-
cURL or file_get_contents in combination with dom
-
$num= "/".$day."/".$month."/".$year; ---->09/02/2009 Is $num= "/".$day."/".$month."/".$year; ---->/09/02/2009 Then: explode("/",$num); Should be: $num = explode("/",$num);//returns Array ( [0] => , [1] => 09, [2] => 02, [3] => 2009); Remove the leading forward slash: $num= $day."/".$month."/".$year; ---->09/02/2009 And you'll get: $num = explode("/",$num);//returns Array ( [0] => 09, [1] => 02, [2] => 2009);
-
$query = "SELECT used FROM records WHERE email = '$enc_email'"; $result = mysql_query($query) or trigger_error('Error: ' . mysql_error()); if ($result && mysql_num_rows($query)) { list($used) = mysql_fetch_row($result);//$used if you need it. But you may have a problem: is there only one mp3 file that can be downloaded once? Or do you want to be able to add multiple mp3 files?
-
<script type="text/javascript"> var price = Array(); var setup = Array(); price['92342257765'] = '15'; price['92342257734'] = '20'; price['92342257778'] = '25'; price['92342258706'] = '30'; price['92342258732'] = '35'; price['92342258700'] = '40'; price['92342258745'] = '45'; price['92342258736'] = '9'; price['92342258697'] = '<?php print $x; ?>'; //replace xx with $x php variable. </script>