mikosiko
Members-
Posts
1,327 -
Joined
-
Last visited
-
Days Won
1
Everything posted by mikosiko
-
which is the value of $query_inrange before this lines? // ECHO $query_inrange here if(!empty($query_inrange)){ //get all fields relating to the photographers that are in range also... I guess that $refine_price variable is ending in a valid operator here right?... or you have a typo? $query = "SELECT * FROM `users` WHERE {$refine_price} `Level_access`=2 AND `active`=1 AND `business_type` LIKE '%1%' AND `unavailable_dates_array` NOT LIKE '%$trimmed%' AND `unavailable_dates_array` !='' AND ID !='".mysql_real_escape_string($_SESSION['user_id'])."' ORDER BY RAND()";
-
... so.. you are not debugging your code at all, otherwise you will probably see easily that you have some error(s) in the code that you are adding to your actually functional code.. 4 suggestions for you: a) add the 2 lines under my signature immediately after your first <?php line those should allow you to display some errors that you could have in your code. b) use at least as a temporary alternative a die("Error : " . mysql_error()) sentence after your mysql_query() p.e $resultB=mysql_db_query($database,$queryB,$link) or die("Error : " . mysql_error()); c) read about the exact syntax for DELETE here ... it point is directly related to your problem d) also will worth for you or your future plans know this requinix point is something also valid to consider
-
how?... any error message?.... how are you debugging your code? at first glance I don't see $row2[hour'] defined in any place in the posted code.
-
Imho you should have 2 tables... Users user_id firstname lastname <+General info for the student> AND UserAttendance user_id attdate att this last one with FK user_id to Users, and UK (user_id + attdate) In you form DATE should be captured only one time.
-
+1 to fenway *shudder* ... but anyway......a subselect to do that?.... why if RIGHT() also exist
-
php dont insert values in database mixed types
mikosiko replied to Karyna's topic in PHP Coding Help
step # 1 echo you raw query and analyze it . your $cuery intent is just nonsense... throw it.. some others observations: 1) sanitize your POSTed variables before use them in the query, otherwise you are open to attacks. and also check how you are using the apostrophes on them. 2) Query in a loop.... in general no good idea... you can use the form INSERT INTO table_name (column_names...) VALUES (1st set of values), (2nd set of values), etc..etc)... -
- I don't see in your new code what AyKay suggested. - How are you debugging your code? - what result are you expecting? (I see only an echo $Estado, that could or couldn't echo something on the screen). - Did you echo your queries to see if they are valid? - Did you echo your POSTed values ? you have several things to do to debug for yourself your code
-
most likely you have a mismatch { around this lines $estado = "Transferência Cancelada: O valor da proposta não é aceitável..." ; } else { /// seems that you are missing a { before this else
-
Allow me to suggest you to describe in details what exactly are you trying to accomplish.. what are you trying to design/solve... every post that you have wrote until now is totally confusing and doesn't explain at all what you are trying to do... with a better explanation probably somebody could give you advice.
-
your schedule table will be ok in that way... your Employee_schedule table should be something like this: (using the data from your first post as an example) ID employee type 1 2 morn 1 3 day 1 5 eve 2 2 morn 2 1 day 2 4 eve for this table as you see the ID correspond to the schedule ID. hence the relation is obvious. Regarding to InnoDB... you should use it if you want to implement and enforce Referencial Integrity constraints (Foreing key p.e). and regarding to the inserts... yes you must use INSERTs for each table involved ... hope this help
-
I will suggest you to redesign your schedule table removing the employee id from it and creating a 3rd table with the employees-by-schedule relation schedule Id date emp-schedule id (FK to the schedule table) emp-id (FK to the employees table) shift-type (morning,day,evening) this should give you more flexibility (more than 1 employee per shift-type in one schedule per example) and the queries should be easier
-
variable $username doesn't exists .... you have one called $user_name ... therefore your comment form is not show and commentbtn is not setup
-
my first answer still valid.... adding a "type" field to differentiate is a valid solution But of course the decision of implement a unique table is going to depend on what exactly are you trying to accomplish or modeling
-
no clear enough what your tables "articles" and "records" represent, but if both tables are identical I don't see stupidity in use just one table... just add a "type" field to differentiate each other
-
most likely you are not connected to the DB, hence the error in your file sysdocupdate.php you have this line for connection $db1 = mysql_connect ("localhost", "root","", "") or die ("cannot connect"); mysql_select_db("polish") or die ("cannot select DB"); and then in your file postupdated.php you have this lines that are different to the previous ones // Connect to mysql and select database $db1 = mysql_connect("localhost", "host", ""); mysql_select_db("polish"); so.. are you sure that you are using the right login credentials in both cases? you should enable error reporting and display errors during develop (look for the 2 lines in my signature)
-
// Run query, check for errors $query = "UPDATE update SET raekke = '".$_POST['raekke']."', modelnr = '".$_POST['modelnr']."', navn = '".$_POST['navn']."', priser = '".$_POST['priser']."', display= '".$_POST['display']."', bruger='".$_POST['bruger']."', salg= '".$_POST['salg']."', usedup='".$_POST['usedup']."', instock = '".$_POST['instock']."', totaltstock='".$_POST['totaltstock']."' WHERE id = '".$_POST['id']."'"; update (used there as a table name) is a mysql reserved word you must enclose it in backtiks ... UPDATE `update` or change the table name (recommended)
-
@fenway: are you saying that this "is evil" too ?
-
thanks KP... I tried in a couple of folders (boards) and is not available.
-
are regular users allowed to initiate a Poll or is only an Administrators option?
-
CREATE TABLE Areas ( Short varchar (3), `Long` varchar (50), Town smallint, Mappable bit ); CREATE TABLE BU (.... ... missing ; to end each table create sentence.
-
of course not.. as you said... that is obvious.... selects must be constructed or modified based on the final objectives (and the OP's objectives were very clear)... and that is obvious too. what if the OP needs to display all the products? well... in that case modify my original query is fairly simple (take no more than 30 seconds maximum). In any case, whatever working query is available (yours, fenway's, mine or from someone else) what the OP or anybody should chose to use is the one that shows the best EXPLAIN plan or PROFILING with a good and representative load of records... any other discussion/consideration is meaningless imho.
-
seems a duplicated post from this http://www.phpfreaks.com/forums/index.php?topic=337858.msg1592091#msg1592091
-
@ebmigue seems that you didn't read neither my first post (Reply # nor my last.... didn't the comment in this line doesn't ring a bell for you? HAVING gp = CONCAT_WS(',',23,45); // or replace here for the attributes that you want ordered asc....
-
you have a "spreadsheet" kind of design for your table Selections... which is really bad... you must reconsider that design, and your query (or the future ones) will be much easier .... maybe: Selections user_id, // FK to your table users.....(JOIN) against it to get the username team // FK to your table teams work on that...
-
$result2 = mysql_fetch_object($worked2); echo($result2-Number) typo? ... that should be $result2->Number ... assuming "Number" is a valid field in your table `map`