Search Results

Search found 891 results on 36 pages for 'comma'.

Page 9/36 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • MySQL UPDATE problem

    - by comma
    I know the following MySQL code is not correct can some help me fix this code to use both tables I'm trying to grab the id from learned_skills and skill_id from users_skills for AND skill_id = id Here is the MySQL code. SELECT learned_skills.*, users_skills.* UPDATE learned_skills SET skill = '$skill', experience = '$experience', years = '$years' WHERE user_id = '$user_id' AND skill_id = id

    Read the article

  • PHP & MySQL - Array to string conversion error problem.

    - by comma
    I keep getting an the following error of Array to string conversion error on this line listed below. How can I fix this problem? $skill = explode('', $_POST['skill']); Here is the PHP & MySQL code. $skill = explode('', $_POST['skill']); $experience = explode('', $_POST['experience']); $years = explode('', $_POST['years']); for ($s = 0; $s < count($skill); $s++){ for ($x = 0; $x < count($experience); $x++){ for ($g = 0; $g < count($years); $g++){ if (mysqli_num_rows($dbc) == 0) { $mysqli = mysqli_connect("localhost", "root", "", "sitename"); $dbc = mysqli_query($mysqli,"INSERT INTO learned_skills (user_id, skill, experience, years, date_created) VALUES ('" . $user_id . "', '" . $skill[$s] . "', '" . $experience[$x] . "', '" . $years[$g] . "', NOW())"); } if ($dbc == TRUE) { $dbc = mysqli_query($mysqli,"UPDATE learned_skills SET skill = '$skill', experience = '$experience', years = '$years', date_created = NOW() WHERE user_id = '$user_id'"); echo '<p class="changes-saved">Your changes have been saved!</p>'; } if (!$dbc) { print mysqli_error($mysqli); return; } } } }

    Read the article

  • MySQL error problem

    - by comma
    I keep getting the error listed below but it only says line 1 what does this mean and how do I fix it? Here is the error I keep getting? You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1' at line 1 here is the code. if (isset($_POST['info_submitted'])) { $user_id = '5'; $mysqli = mysqli_connect("localhost", "root", "", "sitename"); $dbc = mysqli_query($mysqli,"SELECT learned_skills.*, users_skills.* FROM learned_skills INNER JOIN users_skills ON learned_skills.id = users_skills.skill_id WHERE user_id='$user_id'"); $skill = $_POST['skill']; $experience = $_POST['experience']; $year = $_POST['year']; if (mysqli_num_rows($dbc) == 0) { $mysqli = mysqli_connect("localhost", "root", "", "sitename"); $query1 = mysqli_query($mysqli,"INSERT INTO learned_skills (skill, experience, year) VALUES ('" . $skill . "', '" . $experience . "', '" . $year . "')"); } if (!mysqli_query($mysqli, $query1)) { print mysqli_error($mysqli); return; } $mysqli = mysqli_connect("localhost", "root", "", "sitename"); $dbc = mysqli_query($mysqli,"SELECT id FROM learned_skills WHERE id='" . $skill . "' AND experience='" . $experience . "' AND year='" . $year . "'"); if (!$dbc) { print mysqli_error($mysqli); } else { while($row = mysqli_fetch_array($dbc)){ $id = $row["id"]; } } $query2 = "INSERT INTO users_skills (skill_id, user_id, date_created) VALUES ('$id', '$user_id', NOW())"; if (!mysqli_query($mysqli, $query2)) { print mysqli_error($mysqli); return; } if ($dbc == TRUE) { $dbc = mysqli_query($mysqli,"UPDATE learned_skills JOIN users_skills ON (users_skills.skill_id = learned_skills.id) SET skill = '$skill', experience = '$experience', year = '$year'"); echo '<p class="changes-saved">Your changes have been saved!</p>'; } if (!$dbc) { print mysqli_error($mysqli); return; } }

    Read the article

  • Extend DOMElement object

    - by Comma
    How could I exdend objects provided with Document Object Model? Seems that there is no way according to this [issue][2]. class Application_Model_XmlSchema extends DOMElement { const ELEMENT_NAME = 'schema'; /** * @var DOMElement */ private $_schema; /** * @param DOMDocument $document * @return void */ public function __construct(DOMDocument $document) { $this->setSchema($document->getElementsByTagName(self::ELEMENT_NAME)->item(0)); } /** * @param DOMElement $schema * @return void */ public function setSchema(DOMElement $schema){ $this->_schema = $schema; } /** * @return DOMElement */ public function getSchema(){ return $this->_schema; } /** * @param string $name * @param array $arguments * @return mixed */ public function __call($name, $arguments) { if (method_exists($this->_schema, $name)) { return call_user_func_array( array($this->_schema, $name), $arguments ); } } } $version = $this->getRequest()->getParam('version', null); $encoding = $this->getRequest()->getParam('encoding', null); $source = 'http://www.w3.org/2001/XMLSchema.xsd'; $document = new DOMDocument($version, $encoding); $document->load($source); $xmlSchema = new Application_Model_XmlSchema($document); $xmlSchema->getAttribute('version'); I got an error: Warning: DOMElement::getAttribute(): Couldn't fetch Application_Model_XmlSchema in C:\Nevermind.php on line newvermind

    Read the article

  • PHP & MySQL Undefined variable problem

    - by comma
    I keep getting the following error Undefined variable: id on line 91 can some one help me correct this problem? The error is on this line. $query2 = "INSERT INTO users_skills (skill_id, user_id, date_created) VALUES ('$id', '$user_id', NOW())"; MySQL database tables. CREATE TABLE tags ( id INT UNSIGNED NOT NULL AUTO_INCREMENT, skill VARCHAR(255) NOT NULL, experience VARCHAR(255) NOT NULL, years VARCHAR(255) NOT NULL, PRIMARY KEY (id) ); CREATE TABLE users_skills ( id INT UNSIGNED NOT NULL AUTO_INCREMENT, skill_id INT UNSIGNED NOT NULL, user_id INT UNSIGNED NOT NULL, date_created DATETIME UNSIGNED NOT NULL, PRIMARY KEY (id) ); Here is the PHP & MySQL code. if (isset($_POST['info_submitted'])) { $mysqli = mysqli_connect("localhost", "root", "", "sitename"); $dbc = mysqli_query($mysqli,"SELECT learned_skills.*, users_skills.* FROM learned_skills INNER JOIN users_skills ON learned_skills.id = users_skills.skill_id WHERE user_id='$user_id'"); if (!$dbc) { print mysqli_error($mysqli); return; } $user_id = '5'; $skill = $_POST['skill']; $experience = $_POST['experience']; $years = $_POST['years']; $mysqli = mysqli_connect("localhost", "root", "", "sitename"); $dbc = mysqli_query($mysqli,"SELECT learned_skills.*, users_skills.* FROM learned_skills INNER JOIN users_skills ON users_skills.skill_id = learned_skills.id WHERE users_skills.user_id='$user_id'"); if (mysqli_num_rows($dbc) == 0) { if (isset($_POST['skill']) && trim($_POST['skill'])!=='') { $mysqli = mysqli_connect("localhost", "root", "", "sitename"); $query1 = mysqli_query($mysqli,"INSERT INTO learned_skills (skill, experience, years) VALUES ('" . $skill . "', '" . $experience . "', '" . $years . "')"); if (mysqli_query($mysqli, $query1)) { print mysqli_error($mysqli); return; } $mysqli = mysqli_connect("localhost", "root", "", "sitename"); $dbc = mysqli_query($mysqli,"SELECT id FROM learned_skills WHERE id='" . $skill . "' AND experience='" . $experience . "' AND years='" . $years . "'"); if (!$dbc) { print mysqli_error($mysqli); } else { while($row = mysqli_fetch_array($dbc)){ $id = $row["id"]; } } $query2 = "INSERT INTO users_skills (skill_id, user_id, date_created) VALUES ('$id', '$user_id', NOW())"; } }

    Read the article

  • Storing data in a MySQL database using MySQL & PHP

    - by comma
    I'm new to PHP and MySQL and I'm trying to store a users entered data from the following fields $skill, $experience, $years which a user can also add additional fields of $skill, $experience, $years if needed so in instead of 1 of each field there might be multiples of each field. I was wondering how can I store the fields in my MySQL database using PHP and MySQL? I have the following script but I know its wrong. can some one help me fix the script listed below? Here is the PHP and MySQL code. $skill = serialize($_POST['skill']); $experience = serialize($_POST['experience']); $years = serialize($_POST['years']); for (($s = 0; $s < count($skill); $s++) && ($x = 0; $x < count($experience); $x++) && ($g = 0; $g < count($years); $g++)){ $mysqli = mysqli_connect("localhost", "root", "", "sitename"); $query1 = "INSERT INTO learned_skills (skill, experience, years) VALUES ('" . $skill[$s] . "', '" . $experience[$x] . "', '" . $years[$g] . "')"; if (!mysqli_query($mysqli, $query1)) { print mysqli_error($mysqli); return; } } Here is my MySQL table. CREATE TABLE learned_skills ( id INT UNSIGNED NOT NULL AUTO_INCREMENT, skill TEXT NOT NULL, experience TEXT NOT NULL, years INT NOT NULL, PRIMARY KEY (id) ); CREATE TABLE u_skills ( id INT UNSIGNED NOT NULL AUTO_INCREMENT, skill_id INT UNSIGNED NOT NULL, users_id INT UNSIGNED NOT NULL, PRIMARY KEY (id) );

    Read the article

  • Actionscript change default coordinate

    - by Comma
    I have a sprite inside another sprite SpriteB is inside SpriteA I would like to change the default coordinate(top left corner) to say 250,10 When SpriteB.x = 0, SpriteB.y = 0 puts SpriteB to 250,10 in SpriteA Is this possible?

    Read the article

  • Develop an iPhone / iPad Reader app from scratch

    - by Comma
    I'm developing a reader app for viewing and highlighting proprietary format documents. The documents are 2D. (Might add some cool page flip effects) The interface is similar to that of mobile safari. I have no prior experience with iOS development. Could you guys point me to the right direction? (Things I need to consider, tutorials, sample projects...) THX

    Read the article

  • iPhone paging UI

    - by Comma
    I have an app that displays a large amount of information. For paging I'd like to use the "Home Screen" style scrolling/paging instead of the one used in pdf documents (smooth scrolling). How what should I use? also can that UI support more than 20 pages? or is there a better solution?

    Read the article

  • iPad App design decision

    - by Comma
    I would like to develop a reader app for viewing and manipulating proprietary format documents. The documents are 2D. (Might add some cool page flip effects) The interface is similar to that of mobile safari. I'm trying to decide whether to write this in Quartz2D or OpenGL ES. I have no prior experience with either of those. Any suggestions?

    Read the article

  • actionscript array question

    - by Comma
    var array1:Array = new Array(); var array2:Array = new Array(); var obj1:Object = new Object(); array1.push(obj1); array2.push(obj1); if i change something in obj1 will array1[0] and array2[0] also change?

    Read the article

  • Paint app for iPhone

    - by Comma
    I would like to develop a MS paint like app for the iPhone. Could you guys point me to some sample or tutorials on this topic? I'm new to Objective C and Xcode. Thanks

    Read the article

  • PHP & MySQL database storing the name Array problem.

    - by comma
    I'm new to PHP & MySQL and I keep getting the word Array stored in my MySQL tables fields $skill, $experience, $yearsI was wondering how can I fix this problem? And I know I need to add mysqli_real_escape_string which I left out to make code more easier to read Hopefully. Here is the PHP & MySQL code. if (isset($_POST['info_submitted'])) { $mysqli = mysqli_connect("localhost", "root", "", "sitename"); $dbc = mysqli_query($mysqli,"SELECT learned_skills.*, users_skills.* FROM learned_skills INNER JOIN users_skills ON learned_skills.id = users_skills.skill_id WHERE user_id='$user_id'"); if (!$dbc) { print mysqli_error($mysqli); return; } $user_id = '5'; $skill = $_POST['skill']; $experience = $_POST['experience']; $years = $_POST['years']; if (isset($_POST['skill'][0]) && trim($_POST['skill'][0])!=='') { $mysqli = mysqli_connect("localhost", "root", "", "sitename"); $dbc = mysqli_query($mysqli,"SELECT learned_skills.*, users_skills.* FROM learned_skills INNER JOIN users_skills ON users_skills.skill_id = learned_skills.id WHERE users_skills.user_id='$user_id'"); if (mysqli_num_rows($dbc) == 0) { for ($s = 0; $s < count($skill); $s++){ for ($x = 0; $x < count($experience); $x++){ for ($g = 0; $g < count($years); $g++){ $mysqli = mysqli_connect("localhost", "root", "", "sitename"); $query1 = mysqli_query($mysqli,"INSERT INTO learned_skills (skill, experience, years) VALUES ('" . $s . "', '" . $x . "', '" . $g . "')"); $id = mysqli_insert_id($mysqli); if ($query1 == TRUE) { $mysqli = mysqli_connect("localhost", "root", "", "sitename"); $query2 = mysqli_query($mysqli,"INSERT INTO users_skills (skill_id, user_id) VALUES ('$id', '$user_id')"); } } } } } } } Here is the XHTML code. <li><label for="skill">Skill: </label><input type="text" name="skill[0]" id="skill[0]" /> <label for="experience">Experience: </label> <?php echo '<select id="experience[0]" name="experience[0]">' . "\n"; foreach($experience_options as $option) { if ($option == $experience) { echo '<option value="' . $option . '" selected="selected">' . $option . '</option>' . "\n"; } else { echo '<option value="'. $option . '">' . $option . '</option>'."\n"; } } echo '</select>'; ?> <label for="years">Years: </label> <?php echo '<select id="years[0]" name="years[0]">' . "\n"; foreach($grade_options as $option) { if ($option == $years) { echo '<option value="' . $option . '" selected="selected">' . $option . '</option>' . "\n"; } else { echo '<option value="'. $option . '">' . $option . '</option>'."\n"; } } echo '</select>'; ?> </li>

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >