-
Posts
3,372 -
Joined
-
Last visited
-
Days Won
18
Everything posted by Muddy_Funster
-
could you be a little more specific please? just a quick thought - change this line: if(mysql_num_rows($q) == 0) to this if(mysql_num_rows($q) === 0)
-
as your already using FF, and since this looks like a JS/AJAX problem rather than a PHP one, you would be much better off getting and installing the FireBug plugin for FF and using that to realtime debug your JS code in firefox its self.
-
you should never SELECT * from a user information table. You should never SELECT password information from a user information table. you should never store password information in plain text format. That said, try doing a print_r($login1) and see what you get, It's not what you think it is.
-
This was working but now it's not.PLEASE WHY?
Muddy_Funster replied to Finker92's topic in PHP Coding Help
It's not retrieving a result set from the database. use error capture to get the mysql error for each query and that will help identify your problem. If you need more help post the error you get in here. -
Yes, you will need to add companies to the FROM clause because the way it stands just now you arn't actualy refferencing it in the main SELECT. You are using it in a sub query, and that subquery is providing a specific result set that the main SELECT refferences using the aliases that you have given it as though it was a table it's self. the main Query does not get direct access to the tables used in the subquery as it is run independant of the main query.
-
I dont follow your current logic. Why are you setting both year and month in the query for each of $month and $year? also, why does $year allow a search back untill 1970 and the month only go back to 2011?
-
why don't you just make the form element names arrays to begin with?
-
I think this is what your looking for: http://www.php.net/manual/en/datetime.createfromformat.php
-
user login validation from two databse in my website
Muddy_Funster replied to san_v's topic in PHP Coding Help
could you explain more clearly what you are looking for? -
post up the exact code you are using and we'll have a look see
-
not using select * (especialy not from two tables where at least one field on each has the same value) and not using pointless, senseless shorthand aliases for table or field names. fix that and it will be much better.
-
personaly...I think it looks a shambles, but it should work
-
You need to move the insert inside the for each loop. this is basicly running through the array, and overwriting the values of the variables each time untill the last entry. It's not doing anything with the variables each time round, the insert is only being called after the array has been fully run through, thus only inserting 1 record to the database.
-
You have an issue with your quotes somewhere from the look of it. copy and paste your exact code, using code or php tags to enclose it.
-
from the sounds of it you are going to need javascript to make this happen the way you want it.
-
you shouldn't script multiple queries within a single PHP string. execute each query individualy. so for each ";" in your $sql string, you should perform an independant mysql_query().
-
could you post you code please? Limit should not behave the way you are describing.
-
Why would I need to check criteria? In three tables there are... Users user_id Employees id user_id company_id Companies company_id I just need to join those so that I only total the amount of capital where the user is employed by that company. You need the check criteria to tell the SUM not to count every single result returned: SUM( CASE WHEN ( SELECT employee.user_id FROM employees INNER JOIN users ON employees.user_id = users.user_id INNER JOIN companies ON employees.company_id = companies.company_id WHERE company.company_id = "VALUE" AND users.user_id = "VALUE") THEN ( SELECT `capital_field.value`) ELSE 0 END) AS `totalavailable` should work out the total value stored in the field "capital_field" which has both a matching company ID and user ID to whatever VALUE you choose to use.
-
There are always occassions where the query may time out, the server may be down or the connection may have been reset. I'd still check / report on most errors. that the report may never fire is fair enough, but that there may be a problem that is never reported is never good.
-
a more durable method would be to pull the column info from the table in your parent class and then dynamicly populate the variables from the array info within each class. That would provide a more robust solution and would be easier to impliment.
-
it should be date field type simply because you are using it to store dates...if if it doesn't work.
-
changing this line : SUM(`investor_info`.`capital_available`) AS `totalavailable`, To incorporate a CASE like this: SUM(CASE WHEN SELECT `check_criteria`THEN SELECT `capital_field.value`ELSE 0 END) AS `totalavailable`, Should get the result you're after.
-
couldn't you just migrate it and then use ALTER TABLE to change the name?
-
after a little help in moving data from one table to another.
Muddy_Funster replied to jasonc's topic in MySQL Help
you can use joins in subquerie selects for INSERT. -
You also have you if brackets closing too soo... how about a slightly different slant on it: <?php $idioma = $_SESSION['idioma']; if ($idioma=="eng") { $prefix= '<a href="preordering.php"><img src="img/top_banner_'; } else { $prefix='<a href="ordering.php"><img src="img/top_banner_'; } $suffix = '.jpg" width="744" height="182"></a>'; $urlLink = $prefix.$idioma.$suffix; echo "It Worked!! >>>>".$urlLink; ehco "<br><pre>". $urlLink."</pre></br>"; ?> I flung the extra bit in there in case it's a problem with the URL for the img src.