-
Posts
3,372 -
Joined
-
Last visited
-
Days Won
18
Everything posted by Muddy_Funster
-
Couldn't you store the skin decision in the database with the other user credentials? - or be a bit more extreme and alocate skins by end user IP address.
-
What OS are you using? Is it the same as your production server is using? How did you assign read/write access on the folder? What web server are you using IIS or Apache? What version of PHP are you using?
-
could you post your revised code - it looks as though you have put the array() that comes after the = inside the single quotes
-
Don't use a SELECT * to get a single field...also, check the password aswell, in case there are multiple users with the same username. SELECT supporter FROM table WHERE username = 'user' AND password = 'pass'
-
That makes no sense - if $user is a value, and not a field name - also, there is absoloutly no need for backticks in that query.
-
Can't you just have the full A record for the site2.com point to the hosted space used also by site1.com, rather than the way it is set just now?
-
When you perform a select on the MySQL you will loop through the returned records using a WHILE loop. Within the WHILE loop you assign the record returned to your update query and perform that there and then. I have no idea how comfortable you are with PHP and SQL so don't know how much more you need, nor do I have any table information to use to produce any example code. Here is some Psudo that should help: MySQL_Select = SELECT fieldsByName FROM table Execute MySQL_Select OR (Show Error Message) WHILE MySQL_Select returns Rows { MSSql_Update = UPDATE table SET (MSSqlFieldName = FieldReturnedFrom MySQL_Select) [repeat SET(...) for each field to be updated] Execute MSSql_Update OR (Show Error Message) }
-
It can be easily done using a php script, you just need to make sure that you have the relevent libraries enabled, then just run an update on the msSql from within the select loop from the MySql.
-
Not personaly, but I can't imagin a situation where I would be using that kind of setup. I would expect the issue is to do with the redirect from one domain to another, it would make sense that it does not maintain a perpetual connection between pages at the end user level. You will probably need to use custom cookies to store the info on the client machine (assuming that it has cookies enabled) as a workaround.
-
JOINS are part of the FROM clause, not the WHERE one. Also - details of the "fail" are usualy warmly recieved. $query="SELECT submissions.submission_number, submissions.submission_employer_company, submissions.submission_employer_industry, submissions.submission_employer_town_or_postcode, submissions.submission_employer_country, submissions.submission_employer_department, submissions.submission_employer_department_hiring_situation_detailed, submissions.submission_employer_department_hiring_situation_summary, submissions.submission_employer_application_contact, submissions.submission_employer_latitude, submissions.submission_employer_longitude, submissions.submission_account_number, submissions.submission_timestamp, accounts.account_number FROM submissions INNER JOIN accounts ON (submissions.submission_account_number = accounts.account_number) WHERE ((submission_employer_country = '$search_country') AND (submission_employer_department = '$search_department')) ORDER BY submission_timestamp desc limit 10";
-
Sounds like you need a full project analysis on this rather than the advice of a community forum. To answer you in deapth could take pages (although it would require more information from you). If you're wanting to run with it here we will need some more information to effectivly answer your question: 1- What skills are you bringing to the table regards web development? 2- What systems are you planning to run this on? 3- What are you planning to spend on it (ball park obviously).
-
could you please post up your current table structures...I'm having a hard time getting my head round what you are doing here....it sounds insane
-
Chain modifications in relational database
Muddy_Funster replied to silvercover's topic in MySQL Help
I would suggest looking into "foriegn keys" and "cascade indexing" to achieve what you are looking for. -
what about: <?php $checkbox=$_POST['checkbox']; $counter = 1; $append_sring = ''; foreach ($checkbox as $checkboxes) { if($counter == 1){ $append_string .= " WHERE sid='$checkboxes'"; $counter = 2; } else{ $append_string .= " AND sid='$checkboxes'"; } } $append_string .= "GROUP BY teachers.name"; $query_string = "SELECT name FROM teachers RIGHT JOIN subjects ON teachers.sid = subjects.sid $append_string"; $result_set = mysql_query($query_string) or die ('Fatal Error:<br>'.mysql_error()); while ($each_row = mysql_fetch_assoc($result_set){ echo "{$each_row['name']} - teaches all the chosen subjects" } ?> Not tested and probably full of holes, but it should give you something closer to what you are looking for. - Obviously replace field/table names as appropriate.
-
in the interim using brackets should get you the desired effect: ...WHERE ((row_1 = '$value_a ' AND row_2 = '$value_b ' AND row_3 = '$value_c ') OR (row_1 = '$value_c ' AND row_2 = '$value_a ' AND row_3 = '$value_b ') OR (row_1 = '$value_b ' AND row_2 = '$value_c ' AND row_3 = '$value_a ')....( etc etc etc.))"
-
yeah, the s,f and u (glad there's not a t in there as well or it could get offensive ) you do not need to alias your table names, just use the table name where you are using the alias. That said I think there is only one instance whare a column name would be ambiguous and need you to declare the table name prior to the FROM clause. Trying to alias within a JOIN statement never a good idea, so just write it as a simple SELECT field, list,.... FROM table1, table2 LEFT JOIN table3 ON table2.field = table3.field ORDER BY etc.
-
What's wrong with making a master include script that calls a selection of the other includes specific to given criteria?
-
Try it without the sensless and needless aliasing of your three tables and see what happens then.
-
Could be a field name error - like case mistake on User or using User instead of Users. Check the field name first.
-
SELECT month and year FROM datetime
Muddy_Funster replied to Call-911's topic in Microsoft SQL - MSSQL
have a look at here: http://msdn.microsoft.com/en-us/library/ms186724.aspx -
I think you want to use a different function on the date, using a minus converts it on the fly to a unix time value. Try using DATEDIFF or DATE_SUB and see what you get (or CAST the result back into date format after you have applied your logic to it).
-
SELECT Name, Time, Description FROM Table WHERE ((ID = ANY (SELECT ID FROM LinkList WHERE Link LIKE '%term%') OR Name LIKE '%term%' OR Technique LIKE '%term%' OR Origin LIKE '%term%' OR Time LIKE '%term%' ) AND (User_ID='1' OR Public=1)) is that what your looking for?
-
Suddenly getting errors when accessing mysql db using PHP
Muddy_Funster replied to snorky's topic in MySQL Help
assuming that you have admin access to the server then you can force reset the password for mysql without being able to login to the database it's self. this should let you access from the console again where you can then re-apply priviledges and reset passwords. google for MySQL root password reset should get you on the right track. -
take the single quotes out from around $yesdelete - it's an integer field not a string.
-
Question about Foreign Key / Index in MySQL
Muddy_Funster replied to nomadsoul's topic in MySQL Help
It depends - Relationships can be generated on the fly within queries (using RIGHT or LEFT JOIN), they don't need to be declaired through key indexes.