-
Posts
3,372 -
Joined
-
Last visited
-
Days Won
18
Everything posted by Muddy_Funster
-
from all the info you have given, the only answer I can give is : $stringYouWant = $response[102];
-
Delete Table-Row By Pressing The Delete-Button
Muddy_Funster replied to jepperask's topic in MySQL Help
try this as a basic debugging step : if (isset($_POST['delete_id'])) { $qry = "DELETE FROM posts WHERE post_id = " . $post_id; die ($qry); //mysql_query($qry); } make sure the query looks right, if it does, run it directly in the database as a test, if that works then there is nothing wrong with the query, and there is an issue with some other part of the code. p.s. when developing you should always have an or die attached to every query : mysql_query($qry) or die (mysql_error(). "<br /> Error occured during :<br /> $sql"); These should be removed from the code before it goes live and be replaces with generic error displays, while the actual helpfull stuff is store securely in a log file or even emailed to yourself. -
Check If User Is Logged On Or Offline.
Muddy_Funster replied to deathadder's topic in PHP Coding Help
timestamp fields can be set to automaticly update when a change is made to the record that they are a part of. My preffered method is actualy have 2 timestamp fields. 1 for last action, and another for previous action (it's probably just me being a data junky). I then set last action to auto update to current time stamp whenever the record is updated, and make my query to update the table by selecting last action and updating it into previous action. This also gives the bonus, from an analisys point of view, that you can start to build an "average time between actions" to make sure that your auto logouts are set to a time frame that suits the site it's self - assuming your into that kind of thing... -
for a start, your $query is being reset on each itteration of the loop. Additionaly, I don't understand from your description or your code exactly what you are trying to perform here, so can't help any more yet...
-
Trouble Displaying/formating Data In A Table (Help)
Muddy_Funster replied to Chezshire's topic in PHP Coding Help
What are you doing with your if statememnt ( I've not had my coffee yet, so brain is still half asleep...)? I can give you a class to make a table from a dataset, but the dataset needs to be complete before it gets to the class. Also, what's your query look like? -
well you'll need to take a stab it it first, then we can help if you need it, which you might well not. start with looking up glob()
-
it's not likely to be a transport level issue as the domain email is going. I suspect it's a header missmatch in the domain of the server and the sender domain in the mail script. mx record lookup is on of the main header checks done by most mail servers as a standard spam filtering step. webmail hosts have generaly got better spam filtering than domain hosts because the also generaly have way more accounts to maintain.
-
How Can I Save Ringtone From Zedge.net Site Using Curl In Php.
Muddy_Funster replied to hdthanh's topic in PHP Coding Help
The point requinix was making is that you are asking for help to perform something that is in direct breach of that sites usage policy! -
There Is A Problem With Your Queryno Database Selected
Muddy_Funster replied to 50r's topic in PHP Coding Help
I really don't see why you would even consider building a variable $config array to just go and directly define the values as constants anyway. It's totaly pointless. just define the string literals from the beginning. That said, my first guess at the problem would be that you are doing mysql_select_db() inside a private function, without ever returning anything back out from it, so the rest of the class my not have any knowledge of the database being selected. -
I found tiztag.com to be fairly decent for basic tut's
-
do you have any cod ein place at the moment?
-
Was kinda what Jessica and I were getting at to start with, but hey ho.
-
if you insist on not having a UID field then you could try something along the lines of : WHERE ... AND timestampFieldName = (SELECT MAX(timestampFieldName) from tableName) where ... is your current where condition. No promises though.
-
Depending on what sort of backend you are using, you should be able to find loads of OS calandar scripts out there that support this kind of thing. Just grab one of them - the wheel has already hit the market, and it's free.
-
can you post up the (censor as needed) mail header info that outlook is giving you? - mainly interested in the code that the mail is sending in that part of the message. also, you could try setting background-color:blue to see if it's just getting upset about the image (it may be that you actualy have to define the <tbody> element manualy and apply it to that.
-
you could try <table border='1' style='background-image:url("http://servername/img/mail_bg.jpg");width:85%;font-family:Arial;font-size:small;color:white;'> I've never tried to apply a background image to a table before, but I have had tables be strangly fussy about how they take style info. You better check the url I used, it's got an underscore in it, as that's what was in your original post, but I see in your last one there it's not got one...
-
not from the senders side. It would require the security settings on the mail client to be tweeked, setting the senders domain to trusted in the junk filter could be enough, but you may also need to change other options as well. it's a common factor, which is why most people have a "having trouble viewing this message? click here" bit in the mail somewhere that links to a web page version. what's the difference between the image files? are they in the same folder on the server? are the file extensions the correct case (href is case sensitive remember)
-
Passing Variable From Mysql Query To Function
Muddy_Funster replied to Staggan's topic in PHP Coding Help
you could try to apply typcasting on the $row as you assign it to the variable -
yeah, mysql_fetch_assoc() returns one dataset, where the keys are associative names from the table. mysql_fetch_array() returns two datasets, one with associative key names and one with numerical. By associative key names I meen that the array key for the value is the same as the column heading in the database. Rather than echoing, do var_dump($rArray); when you echo "$rArray[$i][$row['filedName6']]"; you will only display the value for the array record at the point of [$i] (which will be set to the last value in the array. If you want to echo each line on its own you will need to step through the array using a loop (as it's multi-dimensional you will need to nest two loops, one inside the other) something like the following for($counter = 0; $counter <= count($rArray)-1; $counter++){ foreach($rArray[$counter] as $key => $value){ echo "\$rArray --> record no $counter --> record key = $key --> record value = $value <br />"; } }
- 24 replies
-
Passing Variable From Mysql Query To Function
Muddy_Funster replied to Staggan's topic in PHP Coding Help
since setResByMatch() is public, throw a die("$m | $r | $s1 | $s2"); in the fist line within the method and see what comes back when using the query method and the test vars. -
yes it is and yes it is. you can call it whatever you like though.
- 24 replies
-
well that's unfortunate. Basicly your error is coming from the fact that something before line xxx is not terminated properly, either a missing semi-colon or closing curly brace is the common cause of this. but if you are striping out lines (which I fully appreciate you're need to do), then that's going to make finding it a little difficult. Here is a suggestion that I think should help. when you are assigning multiple string lines to a variable then use a heredoc string block i.e. $message .= <<<MESSAGE_PT2 <html> <body background='http://internalservername/img/mail_bg_main.jpg' alt='name/description of image' width='100%' height='100%'/><font face='Arial' size='2' color='black'> <table border='0' width='85%' background='http://internalservername/img/mail_bg.jpg' align='center'><font face='Arial' size='2' color='black'> <td> <table border='0' width='43%' align='center'> <td> <font face='Arial' size='2' color='black'>Hi $Name<br><br> Thank you for placing an online order with departmentname. Here is a summary of your order. Please keep this email as a reference if you wish to track your order.<br><br> Your order details are as follows:<br><br> <table border='' width='40%'><font face='Arial' size='2' color='black'> <tr> <td><strong><font face='Arial' size='2' color='black'>Order Number:</strong></td> <td></td> <td><font face='Arial' size='2' color='black'>.$orderNumber.</td> </tr> <tr> <td><strong><font face='Arial' size='2' color='black'>Order Date:</strong></td> <td></td> <td><font face='Arial' size='2' color='black'>.$orderDate.</td> </tr> </table><br><br> <table border='' width='100%'><font face='Arial' size='2' color='black'> <tr> <td width='25%'><font face='Arial' size='2' color='black'><strong>Deal Description</strong></td> <td width='25%'><font face='Arial' size='2' color='black'><strong>Quantity</strong></td> <td width='25%'><font face='Arial' size='2' color='black'><strong>Price</strong></td> <td width='25%' colspan='2'><font face='Arial' size='2' color='black'><strong>Amount</strong></td> </tr> <tr> <td width='25%'><font face='Arial' size='2' color='black'>$dealDescription</td> <td width='25%'><font face='Arial' size='2' color='black'>$quantity</td> <td width='25%'><font face='Arial' size='2' color='black'>$price</td> <td width='12.5%'><font face='Arial' size='2' color='black'>Total</td> <td width='12.5%'><font face='Arial' size='2' color='black'>$total</td> </tr> <table border='0' width='100%'><font face='Arial' size='2' color='black'> <tr> <td><font face='Arial' size='2' color='black'><strong>Returns Policy:</strong> You can cancel this order within two weeks after we have received it. You can return new, unopened items from a cancelled order within 2 weeks after they have been delivered to you. Items should be returned in their original packaging.<br> <br>Should you have any queries, do get in touch with our customer services team on: 0741 000 5555 or send us an email [email protected]<br> <br>Your new phone will be dispatched once all your details are confirmed.<br> <br>Look forward to welcoming you to the family!<br> <br>Best wishes,<br> <font color='CC0000'> departmentname South Africa</td> </tr> </table><br><br> </td> </table> </td> </table> </html> MESSAGE_PT2; use this for all large multi-line string blocks and life should get much easier. Just a note, when closing the heredoc you can not have any leading white space at the start of the line, it must be the first thing on that line.
-
Passing Variable From Mysql Query To Function
Muddy_Funster replied to Staggan's topic in PHP Coding Help
which varaibles arn't getting passed? have you echoed out all the results from the query? why are you using select *? what's the point in $num_rows? why use mysql_fetch_array() rather than mysql_fetch_assoc() when you only address the associated keys from the query result? -
you're looking to do something like $i = 0; while($row = mysql_fetch_assoc($result)){ $rArray[$i][$row['filedName1']] = $row['fieldName1']; $rArray[$i][$row['filedName2']] = $row['fieldName2']; $rArray[$i][$row['filedName3']] = $row['fieldName3']; $rArray[$i][$row['filedName4']] = $row['fieldName4']; $rArray[$i][$row['filedName5']] = $row['fieldName5']; $rArray[$i][$row['filedName6']] = $row['fieldName6']; $i++; //your current code here }
- 24 replies