thank you debasisdas
please dont bother,I fixed it
for anyone having this same problem,here is how i figured it out.
mysql5 defaults the decimal field to 10,0-decimal(10,0)
0 means 0 digits on the right side.change it to 18,9(9 digits on each side-a setting that mimics what most calculators have)
[php]
ALTER TABLE `YourTable` CHANGE `Your_Decimal_C ol` `Your_Decimal_C ol` DECIMAL( 18, 9 ) NOT NULL;...
User Profile
Collapse
-
help getting the remainder of a division in mysql
hello everyone
am trying to insert a division calculation into a mysql column but am unable to get mysql render the result together with the remainder.
I understand i can get the remainder with the Mod or % operator,but that only returns the remainder alone
i want 18/180 to return 0.1 or 0.10
how can i do this
currently it returns 0 ( no odd numbers ,just even ones.)
thank you for your help
[php]... -
would you mind sharing how did you solve it,please?
just curious :)...Leave a comment:
-
Difficulty updating multiple images,need a hand !
Hey you all !
Happy holidays !
I have 2 tables:
Ads
ad_id primary
...
..
Adimages
image_id primary
ad_id FK
......
.....
I make sure to link each ad to its multiple corresponding images,using this:
$ad_id1 = "";
if($ad_id1 != $ad_id){
$ad_id1 = $ad_id;
}
so ad_id=58 in Ad table,will... -
MarkoKlacar
Thank you very much indeed
No,no your description is fine
yes,I got it to work with a nested loop inside the second query.
But I had to remove the join code along with image selection info from first query.
they are both linked now but just a where clause after I have stripped the table name part from the columns in the query.
[php]
"SELECT first_name,last _name,category, title,message...Leave a comment:
-
Sorry for not updating you
Not yet really,do you mean a nested loop ?
If i understood you correctly,I have to delete the image selection info from the select statement(then I dont need the join statement,too) .Instead,I should include your query code inside the outer loop,correct ?
or how does your code fit in my code above ?
Sorry to sound dumb,didnt do it before
and thank you very much for your follow up ! Appreciate...Leave a comment:
-
thanks for your help
"As I see it, it's from .."Members.memb er_id=images.me mber_id", right?"
Yes.
member_id is what links a user to their images,not $firstname (I just missed it above)Leave a comment:
-
Thank you MarkoKlacar,for your response !
I havent done this before so I have no clue how to add a conditioned second loop in my code aboveLeave a comment:
-
Cannot display multiple images per same id in one entry-Need some help
I need to dispaly a user's multiple images in one entry.Right now,say if a user uploads 3 images,three entries for the same id display to match 3 images.
I only want 1 entry to display all of a user's related images like below:
Id
First Name
Last Name
Title
Image1
Image2
Image3
Currently I get;
1
First Name
Last Name
Title
Image1
... -
-
Retrieve an image based on mysql_insert_id in its name
Hi and wish all moderators and members are doing well i
Back with a question after a long while,hope to find the valuable typical support from thescripts people and members.
My host does not offer foreign key feature on tables,so what I did is stick the corresponding submission id in the member's uploaded file when renaming the file.
Each member can upload up to 6 files.
Now,I'm clueless how to... -
Hi there pbmods !
Thanks for your advice
You mean the subdomain configuration?
If you can afford to elaborate a bit on this configuration ,I would be most grateful.
Am on shared hosting,but do I have the priviledge of a custom php.ini
How it is done?
Thanks for your helpLeave a comment:
-
Setting session cookie manually
Hi
I have disabled cookies in my browser just to test and discovered that session cookies are still set by php.I was looking for an example to set a session id cookie manually but couldnt find it.I assume it is set automatically by php as soon as a session start directive is declared.
I just want to store a session id in the cookie to remember data from page to page,not for authentication.
I can set a cookie that... -
Am still learning php myself,but I can suggest you try this:
[code=html]
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="Expires" content="Mon, 01 Jan 1990 12:00:00 GMT">
[/code]
between <head> and </head>
If you are using redirects,you may want to add the following before your actual header:
[php]...Leave a comment:
-
Thank you ajaxrand for all your time and effort you put debugging my code.
There is nothing yet to convince me that sessions cannot be lost when redirecting across folders.So,am searching in that area.May be it's IE7 related.I'll see if on other browsers it's the same or not.
When i redirect to a page with no sessions,the redirect works,when i redirected either backwards or forwards outside a folder to a session page,sessions are lost...Leave a comment:
-
Putting the header at the end of page2 made no difference.
$_SESSION['errmsg'] no longer echoes back to page1.
When I bring page2 back to the same folder as page1,$_SESSION['errmsg'] echoes properly(regard less of where i put the header)Leave a comment:
-
Thank you ajaxrand for your debugging !
I dont understand your comment though
I have no exit after the header so the script continues excuting and inserts into the db.
I made the success message also a error array .And because i have a conditional that if error array is not empty(there's an error) it must exit.This exit with the header above forces it to redirect and echo the error in page1.
There is an exit only if there's...Leave a comment:
-
Page1(form)
[php]
<?php
session_start() ;
foreach($_POST as $key => $val)
$_SESSION[$key] = $val;
?>
<!DOCTYPE phpl PUBLIC "-//W3C//DTD XphpL 1.0 Transitional//EN"
"http://www.w3.org/TR/xphpl1/DTD/xphpl1-transitional.dt d">
<phpl lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xphpl">
<head>...Leave a comment:
-
Lost session across folders
Good morning everyone
I wonder if anyone encountered this situation before.
I have a 2 pages form inside a folder.The second one processes and echoes any errors to page1(thru a redirect).Sessi on data is passed to and fro without using a session id.
All is working fine so far
Now I moved page2 (the processing script) to another folder and correctly modified the path to it.
Now the... -
.htaccess-Deny from all except my ip,blocks all
Good morning everyone
Am hopeful that someone can share me some advice as to the best .htaccess example for a site under development.
When i use something like this:
<Limit GET POST>
order deny,allow
deny from all
allow from my ip
</Limit>
It blocks everybody,inclu ding my ip,generating the following eror:
Forbidden
You don't...
No activity results to display
Show More
Leave a comment: