field

Issues incrementing a field in MySQL/PHP with prepared statements

谁说胖子不能爱 提交于 2019-12-25 02:09:53
问题 I have the following code which is supposed to increment a field value by 1 in a prepared PHP mysql statement: function db_OP_doVote($pdo, $postid, $votetype) { $prepStatement = $pdo->prepare( "UPDATE content_posts SET `:votetype` = `:votetype` + 1 WHERE `id` = :id" ); $prepStatement->execute(array(':votetype' => $votetype, ':id' => $postid)); echo "Success"; } This however, does nothing. No error is thrown back about incorrect SQL syntax and the script runs to completion, but my field does

field access for lists of objects in a class via morphia in mongodb

谁说我不能喝 提交于 2019-12-25 01:35:10
问题 I have some problems while implementing filters in mongodb using morphia POJO mapper. In my class (for example SampleClass ), when i try to access the fields of an @Entity class (in our case it's Person ), I find the field access works fine, using dot notation for general fields like int, string, maps or direct embedded objects. The issue is I could not understand how it works for the case of a "List of Objects" referenced in the Person class. (Assume here, a person can have many addresses,

Multiple fields in query don't work in C++ Builder 6

那年仲夏 提交于 2019-12-25 01:08:54
问题 I am using C++ Builder 6 and I want to query more than one field/column in my query to a table of my MySQL database. Let's say, I have a table named "users" and my table has the fields "id", "name", "username" and "password". Please, check the following examples: query = "SELECT name FROM users;"; // WORKS query = "SELECT name, username FROM users;"; // WORKS ONLY FOR THE 1ST FIELD "name" query = "SELECT * FROM users;"; // DOESN'T WORK: GIVES ME EAccessViolation query = "SELECT name FROM

Passing field-symbols into FORM

こ雲淡風輕ζ 提交于 2019-12-25 00:25:57
问题 I need to assign data field (component of another field symbol) to field-symbol in a several places of code. For the sake of reusability I decided to encapsulate this code in procedure, but I cannot understand how to pass field-symbols into this procedure. LOOP bseg ASSIGNING <bseg> ... PERFORM assigning USING <bseg> CHANGING <wrbtr>. ... ENDLOOP. FORM assigning USING <bseg> TYPE bseg CHANGING <wrbtr> TYPE bseg-wrbtr IF ... some logic here ASSIGN <bseg>-wrbtr TO <wrbtr>. ELSE ASSIGN <bseg>

Checking for unfilled fields with PHP

冷暖自知 提交于 2019-12-24 20:26:47
问题 I am creating a checkout page that requires the client to fill out his personal information as well as his credit card details (this part using stripe). I was wondering, what is the best way to check whether the fields are filled up or not? Shall I do it in the processingPayment.php that $_POSTs the fields and processes payment, and in case the fields were not filled, I would redirect back to checkout? Or is it a better idea to use js to check on the spot before submitting the form? if in the

django set default value of a model field to a self attribute

半城伤御伤魂 提交于 2019-12-24 14:55:47
问题 I have a model called Fattura, and I would like to set the default value of the field "printable" to a string that includes the value of the field "numero". But I have the error that link_fattura has less arguments, but if I add default=link_fattura(self) I have an error because self is not defined. How can I solve this issue? class Fattura(models.Model): def link_fattura(self, *args, **kwargs): return u"http://127.0.0.1:8000/fatture/%s/" % (self.numero) data = models.DateField() numero =

How to rename a PDF form field when the field name contains a period using iTextSharp

时光怂恿深爱的人放手 提交于 2019-12-24 12:08:21
问题 I use iTextSharp to rename PDF form field. The old field names and the new replacement names are entered in a text box (comma separated). My code then loops through each line, grabs the old field name, looks for the field in the PDF and renames it to the new field. Finally, a new PDF is created from the old PDF, and all of the fields in the new PDF will have the new names. My problem is that I can't seem to rename the PDF fields which contain a period in the field name (e.g. First.Name). Is

C# Retrieve FormFields from Word Document and Insert into Text file

牧云@^-^@ 提交于 2019-12-24 10:50:47
问题 I'm trying to figure out how to iterate through a document and pull all form fields and insert them into a new text file. I'm working through it trying to find examples of the functions I'm going to need and I'm not coming up with a lot of information. Maybe I'm not searching properly though. Here's what I've written so far. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using

Making the RichTextField Horizontally Centered in Blackberry

淺唱寂寞╮ 提交于 2019-12-24 10:24:12
问题 My current Mainscreen looks like : The current code for each line of display is like: RichTextField WeFix1 = new RichTextField("• Computer & Laptop", RichTextField.TEXT_JUSTIFY_HCENTER); VFMTitle1 = new VerticalFieldManager(Field.USE_ALL_WIDTH| Field.NON_FOCUSABLE); HFMTitle1 = new HorizontalFieldManager(FIELD_HCENTER); HFMTitle1.add(WeFix1); VFMTitle1.add(HFMTitle1); add(VFMTitle21); But need to it be positioned in a straight line : 回答1: There are many possibilities. You can adjust the

Conditional printing depending of empty or null value in Crystal Reports

会有一股神秘感。 提交于 2019-12-24 06:48:37
问题 Suppose I have an StoredProcedure that returns a unique row corresponding to a table with columns "Name" and "Surname". I want the report to show: Name: NameField Surname: SurnameField Where the "NameField" and "SurnameField" are the fields returned by the StoredProcedure. The special requirement, is that if "SurnameField" is empty or null, then I don't want to show the "Surname: SurnameField". How can I achieve this? The only thing that I thought is breaking the storedprocedure in two, one