Dathremar
-
Posts
169 -
Joined
-
Last visited
Posts posted by Dathremar
-
-
Try changing this $_FILES["img$imgNumb"][name] to $_FILES['img$imgNumb'][name]
in the do while loop and everywhere You use that.
Also if that does not work try $_FILES["img".$imgNumb][name]
-
Does this script work ?
Cuz I see the action of the form empty.
-
I think You should change
for ($i=0; $i<= $b; $i++) { if ($a[$i] == $cat['id']) { $checked .= 'checked="checked"'; } }
To:
$checked = (in_array($cat['id'] ), $a) ? 'checked="checked"' : "";
The statement $checked .= 'something' concats the string to the already existing $checked variable. Probably that is why You got all the check boxes checked.
Hope this helps
-
well Your submit button is named "Submit" and not "submit"
-
echo "<img src='".$avatar_path. $avatar_name ."'>";
in the src You need to give the exact location of the picture that needs to be displayed.
-
echo "<img src='".$avatar_path."'>";
-
I failed there :S Sorry, lack of info, thought it could be done with ini_set... my bad
-
-
Ok so even though I still don't get why You can't loop echo them out in a table, I would recommend joining the 2 arrays into one 2 dimensional array ie.
$array3 = array_combine($array1, $array2); foreach ($array3 as $img => $desc) { echo "<tr><td>".$img ."</td><td>".$desc."</td></tr>"; // or any other format ir div, span or w/e }
Hope it helps
-
Why is it hard to format them as you want to?
Can You give me more of the code, to try to format the output.
-
Well then something like this:
for ($i=0; $i < count($array1); $i++) { echo "<tr><td>".$array1[$i]."</td><td>".$array2[$i]."</td></tr>"; }
That should give You separate row with the info image / text. You may echo it in any style ofc
-
Well does this mean that both arrays have same amount of elements?
-
if($_POST['shout'] == "Shout"){ $to = $_POST['to']; $from = $_POST['from']; $message = $_POST['message']; $messagesql = $op->insert("INSERT INTO ".tbl_message." (toid,fromid,message,date) VALUES ('".$to."','".$from."','".$message."','".date('Y-m-d:h:i')."')"); if($messagesql > 0){ // add mail function here $err_msg_shout="Shout Posted: ".$message; // displaying the message else{ $err_msg_shout="Error, Try Again"; } }}
and for sending mail use mail() function.
-
Ok if theres 10 ppl and 7 say yes and 3 say no - what percentage says yes
Answer : 23%
That doesn't make any sense.
But if You want to make a percentage of something you need to know whats the max ie.
10 ppl
7 say yes
3 say no
so 7*1/10 = 0.7 * 100 = 70% yes ppl
3 * 1 / 10 = 0.3 * 100 = 30% no ppl
ie2.
1230 ppl and 14 say yes and 1216
1216*100 * 1/1230 = yes percentage
14 *100 1/1230 = no percentage
Hope you understand this
-
Well If You know how to get the info out of the database, then like You said simply add as many dots/bars to the html. Then ofc use css to make them to look as you like.
For the SQL part use the count() function to count the number of hits in the db, so you wont have to loop through a whole bunch of results, but just You will get one row of data.
-
echo "<tr class='" . $class . "' ><td>";
-
try this:
'text' => '<!-- webim button --><a href="/webim/client.php?locale=en" target="_blank" onclick="if(navigator.userAgent.toLowerCase().indexOf(\'opera\') != -1 && window.event.preventDefault) window.event.preventDefault();this.newWindow = window.open(\'/webim/client.php?locale=en&url=\'+escape(document.location.href)+\'&referrer=\'+escape(document.referrer), \'webim\', \'toolbar=0,scrollbars=0,location=0,status=1,menubar=0,width=640,height=480,resizable=1\');this.newWindow.focus();this.newWindow.opener=window;return false;"><img src="/webim/button.php?image=webim&lang=en" border="0" width="163" height="61" alt=""/></a><!-- / webim button -->'
);
And can You tell us what the error says?
Install FireBug in Firefox it helps for solving errors
-
It is the same thing again. You tend to use singe quotes inside a quoted statement.
If You quote something with ' then all the ' used inside should be escaped, like Russel said.
So put \ in front of the ' that are inside you command.
-
just use: "INSERT INTO table_name ( column1, column2, column3 ) VALUES ( 'value1', 'value2', now() )";
read this time and date functions
-
$result = mysql_query($query) or die(mysql_error());
print that please
-
There is a print_r function in php, but I doubt You will want that kind of output
But You can always do something like:
for ($i=0; $i < count($table_list); $i++) { echo $table_list[$i]; }
-
This query "SELECT COUNT(*) FROM `$table` WHERE `site` LIKE '$entry'" will always have only one record which will contain the number of matches.
-
Is this search button only for mobile phones?
If yes, split the search field into two fields and mark them manufacturer and model so then we can know which words to get priority in the search.
If no, then I will tell You again that the thing You want to be done is not really easy to do as a matter of fact with the table You have not sure if You can do it at all without making a lot of queries and php mathematics which will really burden your server.
-
Hello again
Yes You can check for words that have integer values in them and run the query with them, but again what if user enters for instance:
Nokia n97 6100,
then we get search words: Nokia; n97; 6100
We make the query like:
(SELECT fileds_to_select, red 1 FROM product_table WHERE ( (product_name LIKE '%n97%') OR ( product_name LIKE '%6100%') ) )
UNION
(SELECT fileds_to_select, red 2 FROM product_table WHERE ( (product_name LIKE '%Nokia%') ) )
ORDER BY red
The result will have 2 rows for the 1st query and ie. 10 rows for second:
Again we have problem cuz the Nokia 6100 may be the 1st result and then Nokia n97 ...
It will be more accurate, but not sure if this satisfy Your needs
[SOLVED] PHP/MYSQL vague error warning
in PHP Coding Help
Posted
Your query is broken. Use ' around your variables and also try addslashes() to escape illegal chars before inserting into DB