Forum Replies Created

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter cuk

    (@cuk)

    Hm, I read it and tried to alter the code, but it didn’t work…
    Any further help would be greatly appreciated.

    Thread Starter cuk

    (@cuk)

    I’m getting this:

    Fatal error: Call to a member function insert() on a non-object in /home/a2865846/public_html/wp-content/themes/twentyeleven-dijete/trazilica_jedan.php on line 4

    This is the whole code from trazilica_jedan.php

    <?php
    if (isset($_POST['znamen'])){
      $lepo = $_POST['znamen'];
      $update = $wpdb->insert('users', array('user_id' => 12, 'uporabniki' => 'trajj'),array("%d", "%s"));
      echo "$update";
    }
    else {
      echo "napaka! :(";
    }
    ?>

    It is activated from the template file trazilica_dva.php. This is the part:

    $.post('https://sklopnjak.uni.me/wp-content/themes/twentyeleven-dijete/trazilica_jedan.php', {znamen:znamen},function (data){
    			$('#save_status').text(data);
    			 });

    Some ideas?

    Thread Starter cuk

    (@cuk)

    @andrew, nope. No errors. I fixed the URL problem, still it seems drugi.php doesn’t even get activated.
    @samuel, wrappers didn’t solve the problem.

    Sorry, now it does output some error, but the error’s about wpdb insert. I don’t know what made it change…

    Thread Starter cuk

    (@cuk)

    Thanks! It works ??
    Yep, everything done on a child theme.

    Thread Starter cuk

    (@cuk)

    https://bojiste.uni.me/?page_id=72&id=0&upis=refer

    buttons with regular, regular (font), regular expression

    Forum: Hacks
    In reply to: echo returns "Array"
    Thread Starter cuk

    (@cuk)

    I had problems with picking the right array type. Works with associative. Thanks!

    Forum: Hacks
    In reply to: echo returns "Array"
    Thread Starter cuk

    (@cuk)

    Thanks, but I bumped into another problem. The previous piece of code was written in a page template together with an HTML form. I didn’t know which URL to put into the action attribute, so I made a new PHP file called database_list.php (in the child theme folder):

    <?php
    	if (isset ($_GET['upis'])&&!empty($_GET['upis'])){
    	$upis=$_GET['upis'];
      	$mocnesi=$wpdb->get_var("SELECT engleski, prijevod FROM rjecnik WHERE id = $upis");
    	echo $mocnesi;
      	}
    ?>

    And I moved the form code into the main page:

    <form action="database_list.php" method="get">
      Upisite rijec!
      Trazena rijec: <input type="number" name="upis">
      <input type="submit" value="Trazi">
    </form>

    I don’t know how to return the $mocnesi value found by the query to html to display. Any help?

    Thread Starter cuk

    (@cuk)

    Yes. No luck for now.

    If I understand well, most practical way to do it would be by uploading the dictionary to the mysql database and then creating a php file that connects WordPress with it…

    Any thoughts?

    Thread Starter cuk

    (@cuk)

    I have. Unfortunately they are not so convenient if a dictionary has 2k+ entries.
    I don’t know what exactly I expected from making this topic – I simply hoped someone could share a tip, give me a general guideline or point me to a tutorial :/

    Thread Starter cuk

    (@cuk)

    I thought WordPress would be an adequate platform for that. I mean for making such a dictionary.

Viewing 10 replies - 1 through 10 (of 10 total)